]> granicus.if.org Git - python/commitdiff
bpo-30557: Fix test_faulthandler (#1969)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 6 Jun 2017 17:40:41 +0000 (19:40 +0200)
committerSteve Dower <steve.dower@microsoft.com>
Tue, 6 Jun 2017 17:40:41 +0000 (10:40 -0700)
On Windows 8, 8.1 and 10 at least, the exit code is the exception
code (no bit is cleared).

Lib/test/test_faulthandler.py

index c965d67db3437dee91abba9da288adb40ad13543..e2fcb2b852deebd8f00a791e32c5067ca3c9720b 100644 (file)
@@ -777,8 +777,10 @@ class FaultHandlerTests(unittest.TestCase):
                 """
             )
             self.assertEqual(output, [])
-            # Actual exception code has bit 4 cleared
-            self.assertEqual(exitcode, exc & ~0x10000000)
+            # On Windows older than 7 SP1, the actual exception code has
+            # bit 29 cleared.
+            self.assertIn(exitcode,
+                          (exc, exc & ~0x10000000))
 
     @unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
     def test_disable_windows_exc_handler(self):