def interrupt(): # sleep here so that the main thread in the test can get to the sleep too (otherwise # if we interrupt too fast we won't really check that the sleep itself # got interrupted -- although if that happens on some tests runs it's # not really an issue either). time.sleep(1) interrupt_main_thread(main_thread)
def interrupt(self): self.buffer = None # Also clear the buffer when it's interrupted. try: if self.interruptable: # Fix for #PyDev-500: Console interrupt can't interrupt on sleep interrupt_main_thread(self.mainThread) self.finish_exec(False) return True except: traceback.print_exc() return False
def raise_on_this_thread(): pydev_log.debug('Callback to interrupt main thread.') pydevd_utils.interrupt_main_thread(main_thread)