We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99040b6 commit ac8cf87Copy full SHA for ac8cf87
Lib/test/test_threading.py
@@ -445,9 +445,14 @@ def catch_exception():
445
self.assertEqual(result, 1)
446
447
for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
448
- signal.pthread_kill(thread.ident, signal.SIGUSR1)
449
if not thread.is_alive():
450
break
+ try:
451
+ signal.pthread_kill(thread.ident, signal.SIGUSR1)
452
+ except OSError:
453
+ # The thread might have terminated between the is_alive check
454
+ # and the pthread_kill
455
+ break
456
457
thread.join()
458
signal.signal(signal.SIGUSR1, signal.SIG_DFL)
0 commit comments