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 dd683f8 commit 6b4e3feCopy full SHA for 6b4e3fe
Lib/test/test_interpreters/test_api.py
@@ -459,7 +459,12 @@ def test():
459
error = proc.stderr.read()
460
self.assertIn(b"KeyboardInterrupt", error)
461
retcode = proc.wait()
462
- self.assertEqual(retcode, 0)
+ # Sometimes we send the SIGINT after the subthread yields the GIL to
463
+ # the main thread, which results in the main thread getting the
464
+ # KeyboardInterrupt before finalization is reached. There's not
465
+ # any great way to protect against that, so we just allow a -2
466
+ # return code as well.
467
+ self.assertIn(retcode, (0, -signal.SIGINT))
468
469
470
class TestInterpreterIsRunning(TestBase):
0 commit comments