Example #1
0
            def _bootstrapQThread(self, run):
                """
                Bootstrap for QThread, which reports exceptions correctly.
                
                @param run the run method of *.QThread
                @type method pointer
                """
                global _qtThreadNumber

                newThread = DebugBase(_debugClient)
                ident = _thread.get_ident()
                name = 'QtThread-{0}'.format(_qtThreadNumber)

                _qtThreadNumber += 1

                newThread.id = ident
                newThread.name = name

                _debugClient.threads[ident] = newThread

                # see DebugBase.bootstrap
                sys.settrace(newThread.trace_dispatch)
                try:
                    run()
                except SystemExit:
                    # *.QThreads doesn't like SystemExit
                    pass
                except Exception:
                    excinfo = sys.exc_info()
                    newThread.user_exception(excinfo, True)
                finally:
                    sys.settrace(None)
Example #2
0
 def _bootstrap(self, run):
     """
     Bootstrap for threading, which reports exceptions correctly.
     
     @param run the run method of threading.Thread
     @type method pointer
     """
     newThread = DebugBase(_debugClient)
     _debugClient.threads[self.ident] = newThread
     newThread.name = self.name
     # see DebugBase.bootstrap
     sys.settrace(newThread.trace_dispatch)
     try:
         run()
     except Exception:
         excinfo = sys.exc_info()
         newThread.user_exception(excinfo, True)
     finally:
         sys.settrace(None)