Commits

André Sintzoff committed 005719e

annotate: handle incompatibility (sip-4.12.2 and Python <2.5.3)

Thanks to Yuya for suggestion

The symptom was:
TypeError: 'sip.methoddescriptor' object is not callable on
thread2._async_raise(self._threadid, KeyboardInterrupt)

See:
http://www.riverbankcomputing.com/pipermail/pyqt/2011-February/029217.html
http://bugs.python.org/issue4230

  • Participants
  • Parent commits 1f16cc8
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgqt/annotate.py

     'Background thread for annotating a file at a revision'
     def __init__(self, parent=None):
         super(_AnnotateThread, self).__init__(parent)
+        self._threadid = None
 
     @pyqtSlot(object)
     def start(self, fctx):
 
     @pyqtSlot()
     def abort(self):
+        if self._threadid is None:
+            return
         try:
             thread2._async_raise(self._threadid, KeyboardInterrupt)
             self.wait()
-        except (AttributeError, ValueError):
+        except ValueError:
             pass
 
     def run(self):
         except KeyboardInterrupt:
             pass
         finally:
-            del self._threadid
+            self._threadid = None
             del self._fctx
 
 class AnnotateDialog(QMainWindow):