Skip to content

Commit 1afb202

Browse files
committed
Fix test_crashers on Windows
1 parent 00b9633 commit 1afb202

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Lib/test/test_crashers/__init__.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ def test_crashers_crash(self):
3232
if support.verbose:
3333
print(f"Checking crasher: {script}", flush=True)
3434
proc = assert_python_failure(fname)
35-
self.assertLess(proc.rc, 0, proc)
35+
if os.name != "nt":
36+
# On Unix, if proc.rc is negative, the process was killed
37+
# by a signal
38+
self.assertLess(proc.rc, 0, proc)
39+
else:
40+
# Windows. For example, C0000005 is an Access Violation
41+
self.assertGreaterEqual(proc.rc, 0xC0000000, proc)
3642

3743

3844
def tearDownModule():

0 commit comments

Comments
 (0)