diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-04-21 16:06:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 16:06:13 (GMT) |
commit | 46c2b81026bbf966c0898a1fa30d98c33673aea0 (patch) | |
tree | 8fe6be2610839b6be6b0d0b847497191a38a90eb /Lib/test/test_faulthandler.py | |
parent | 2a1aed04b0943636f605543522e16cca1dc23e70 (diff) | |
download | cpython-46c2b81026bbf966c0898a1fa30d98c33673aea0.zip cpython-46c2b81026bbf966c0898a1fa30d98c33673aea0.tar.gz cpython-46c2b81026bbf966c0898a1fa30d98c33673aea0.tar.bz2 |
bpo-30125: Fix faulthandler.disable() on Windows (#1240)
* bpo-30125: Cleanup faulthandler.c
* Use size_t type for iterators
* Add { ... }
* bpo-30125: Fix faulthandler.disable() on Windows
On Windows, faulthandler.disable() now removes the exception handler
installed by faulthandler.enable().
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r-- | Lib/test/test_faulthandler.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 28dd5f4..626e245 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -754,6 +754,18 @@ class FaultHandlerTests(unittest.TestCase): 3, name) + @unittest.skipUnless(MS_WINDOWS, 'specific to Windows') + def test_disable_windows_exc_handler(self): + code = dedent(""" + import faulthandler + faulthandler.enable() + faulthandler.disable() + code = faulthandler._EXCEPTION_ACCESS_VIOLATION + faulthandler._raise_exception(code) + """) + output, exitcode = self.get_output(code) + self.assertEqual(output, []) + self.assertEqual(exitcode, 0xC0000005) if __name__ == "__main__": |