# HG changeset patch
# User Yuki KODAMA <[email protected]>
# Date 1243317727 -32400
# Node ID f10d77c460a82778f944bda1088559ec8b1decfa
# Parent 5b32caf33fd440faaadca9632158d821cc373c67
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'.
diff --git a/hggtk/gtklib.py b/hggtk/gtklib.py
--- a/hggtk/gtklib.py
+++ b/hggtk/gtklib.py
@@ -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,
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop