Changeset 3873


Ignore:
Timestamp:
Apr 4, 2019 8:56:32 AM (3 years ago)
Author:
toby
Message:

trap error if unable to delete seq files

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3869 r3873  
    650650            elif result != wx.ID_CANCEL:
    651651                #print('deleting .seqXXXX files')
    652                 os.remove(GPXphase)
    653                 os.remove(GPXhist)
     652                try:
     653                    os.remove(GPXphase)
     654                except:
     655                    print('Warning: unable to delete {}'.format(GPXphase))
     656                try:
     657                    os.remove(GPXhist)
     658                except:
     659                    print('Warning: unable to delete {}'.format(GPXhist))
    654660        finally:
    655661            dlg.Destroy()
     
    754760        hist.close()
    755761        #print('deleting .seqXXXX files')
    756         os.remove(GPXphase)
    757         os.remove(GPXhist)
     762        try:
     763            os.remove(GPXphase)
     764        except:
     765            print('Warning: unable to delete {}'.format(GPXphase))
     766        try:
     767            os.remove(GPXhist)
     768        except:
     769            print('Warning: unable to delete {}'.format(GPXhist))
    758770    G2frame.SetTitleByGPX()
    759771   
  • trunk/GSASIIstrIO.py

    r3855 r3873  
    794794    # clean up tmp files
    795795    tmpHistIndex.clear()
    796     os.remove(GPXphase)
    797     os.remove(GPXhist)
     796    try:
     797        os.remove(GPXphase)
     798    except:
     799        print('Warning: unable to delete {}'.format(GPXphase))
     800    try:
     801        os.remove(GPXhist)
     802    except:
     803        print('Warning: unable to delete {}'.format(GPXhist))
    798804    print ('GPX file merge completed')
    799805
Note: See TracChangeset for help on using the changeset viewer.