summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-16 11:53:45 (GMT)
committerGitHub <noreply@github.com>2017-11-16 11:53:45 (GMT)
commit33217d22131ab1ffaa09a6944bae704f722f25a9 (patch)
tree0220bc771bba16f98d53e621e3d53110a9ff9fc1 /Lib
parentf35076a002b958f991d180d6f945344cc5ab3900 (diff)
downloadcpython-33217d22131ab1ffaa09a6944bae704f722f25a9.zip
cpython-33217d22131ab1ffaa09a6944bae704f722f25a9.tar.gz
cpython-33217d22131ab1ffaa09a6944bae704f722f25a9.tar.bz2
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929) (#4416)
(cherry picked from commit 6e3d6b5dc22cd06d8c4d44a38a8a3415e4bebb16)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_faulthandler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 20fe1e2..b8d8ea3 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -756,6 +756,22 @@ class FaultHandlerTests(unittest.TestCase):
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
# faulthandler display the traceback when they are