def subthread(): try: time.sleep(0.5) with __pypy__.thread.signals_enabled: thread.interrupt_main() except BaseException, e: interrupted.append(e)
def subthread(): try: with __pypy__.thread.signals_enabled: thread.interrupt_main() for i in range(10): print 'x' time.sleep(0.1) except BaseException, e: interrupted.append(e)
def subthread(): print('subthread started') try: with __pypy__.thread.signals_enabled: thread.interrupt_main() for i in range(10): print('x') time.sleep(0.25) except BaseException, e: interrupted.append(e)
def subthread(): print('subthread started') try: with __pypy__.thread.signals_enabled: thread.interrupt_main() for i in range(10): print('x') time.sleep(0.25) except BaseException as e: interrupted.append(e) finally: print('subthread stops, interrupted=%r' % (interrupted,)) done.append(None)
def subthread(): print('subthread started') try: with __pypy__.thread.signals_enabled: thread.interrupt_main() for i in range(10): print('x') time.sleep(0.25) except BaseException as e: interrupted.append(e) finally: print('subthread stops, interrupted=%r' % (interrupted, )) done.append(None)