Commits

Yuya Nishihara  committed 8193a8a

work around pyqt bug

  • Participants
  • Parent commits ecca30a

Comments (0)

Files changed (1)

File thread-noexcsup.diff

 
 Our sys.excepthook defined in run.qtrun is thread-safe, so we can pop up
 BugReport dialog in this case.
-
 Also, even if run() raises exception, CmdThread will emit commandFinished
 and the GUI will notice that the command exited abnormally.
 
+But, PyQt 4.9.6 (Windows) seems to have the following issue and sys.excepthook
+cannot be called. This problem does not exist in PyQt 4.10 (Windows) and
+python-qt4 4.9.3-4 (Debian GNU/Linux).
+
+http://en.it-usenet.org/thread/16065/24764/
+http://www.riverbankcomputing.com/hg/sip/rev/45a50c6d82fe
+
 diff --git a/tortoisehg/hgqt/thread.py b/tortoisehg/hgqt/thread.py
 --- a/tortoisehg/hgqt/thread.py
 +++ b/tortoisehg/hgqt/thread.py
  import Queue
  import time
  import urllib2, urllib
-@@ -369,11 +368,6 @@ class CmdThread(QThread):
-                 ui.warn(local._("abort: %s: %s\n") % (inst.strerror, inst.filename))
+@@ -370,10 +369,8 @@ class CmdThread(QThread):
              else:
                  ui.warn(local._("abort: %s\n") % inst.strerror)
--        except Exception, inst:
+         except Exception, inst:
 -            if 'THGDEBUG' in os.environ:
 -                import traceback
 -                traceback.print_exc()
--            ui.write_err(str(inst) + '\n')
+             ui.write_err(str(inst) + '\n')
++            raise
          except KeyboardInterrupt:
              self.ret = -1