Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/test/test_interpreters/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,12 @@ def test():
error = proc.stderr.read()
self.assertIn(b"KeyboardInterrupt", error)
retcode = proc.wait()
self.assertEqual(retcode, 0)
# Sometimes we send the SIGINT after the subthread yields the GIL to
# the main thread, which results in the main thread getting the
# KeyboardInterrupt before finalization is reached. There's not
# any great way to protect against that, so we just allow a -2
# return code as well.
self.assertIn(retcode, (0, -signal.SIGINT))


class TestInterpreterIsRunning(TestBase):
Expand Down
Loading