mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929)
bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM exceptions.
This commit is contained in:
parent
c0cabc23bb
commit
6e3d6b5dc2
3 changed files with 36 additions and 3 deletions
|
@ -748,6 +748,22 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
3,
|
||||
name)
|
||||
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_ignore_exception(self):
|
||||
for exc_code in (
|
||||
0xE06D7363, # MSC exception ("Emsc")
|
||||
0xE0434352, # COM Callable Runtime exception ("ECCR")
|
||||
):
|
||||
code = f"""
|
||||
import faulthandler
|
||||
faulthandler.enable()
|
||||
faulthandler._raise_exception({exc_code})
|
||||
"""
|
||||
code = dedent(code)
|
||||
output, exitcode = self.get_output(code)
|
||||
self.assertEqual(output, [])
|
||||
self.assertEqual(exitcode, exc_code)
|
||||
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_raise_nonfatal_exception(self):
|
||||
# These exceptions are not strictly errors. Letting
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue