Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

gtklib: catch unknown error when canceled 'export patch'

With this fix, changelog dialog won't show traceback
dialog when the user canceled 'export patch' command
in Windows native 'Save As' dialog.
Although the error is a kind of 'pywintypes.error'.

Changeset 0184a8c7759c

Parent b31c1f55fdbb

by Yuki KODAMA

Changes to one file · Browse files at 0184a8c7759c Showing diff from parent b31c1f55fdbb Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​gtklib.py Stacked
 
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
210
211
 
193
194
195
 
 
 
 
 
 
 
 
 
 
 
 
 
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
@@ -193,19 +193,21 @@
    def runWindows(self):   import win32gui, win32con - fname, customfilter, flags=win32gui.GetSaveFileNameW( - InitialDir=self.InitialDir, - Flags=win32con.OFN_EXPLORER, - File=self.FileName, - DefExt='py', - Title=hglib.fromutf(self.Title), - Filter="", - CustomFilter="", - FilterIndex=1) - if fname: - return fname - else: - return False + try: + fname, customfilter, flags=win32gui.GetSaveFileNameW( + InitialDir=self.InitialDir, + Flags=win32con.OFN_EXPLORER, + File=self.FileName, + DefExt='py', + Title=hglib.fromutf(self.Title), + Filter='', + CustomFilter='', + FilterIndex=1) + if fname: + return fname + except: + pass + return False     def runCompatible(self):   file_save = gtk.FileChooserDialog(self.Title, None,