mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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().
This commit is contained in:
parent
2a1aed04b0
commit
46c2b81026
2 changed files with 31 additions and 24 deletions
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue