mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-108082: Remove _PyErr_WriteUnraisableMsg() (GH-111643)
Replace the remaining calls with PyErr_FormatUnraisable().
This commit is contained in:
parent
0d3df272fb
commit
26c0e5e03a
13 changed files with 85 additions and 147 deletions
|
@ -19,7 +19,9 @@ class GeneralTest(unittest.TestCase):
|
|||
atexit.register(func, *args)
|
||||
atexit._run_exitfuncs()
|
||||
|
||||
self.assertEqual(cm.unraisable.object, func)
|
||||
self.assertIsNone(cm.unraisable.object)
|
||||
self.assertEqual(cm.unraisable.err_msg,
|
||||
f'Exception ignored in atexit callback {func!r}')
|
||||
self.assertEqual(cm.unraisable.exc_type, exc_type)
|
||||
self.assertEqual(type(cm.unraisable.exc_value), exc_type)
|
||||
|
||||
|
@ -125,7 +127,9 @@ class GeneralTest(unittest.TestCase):
|
|||
try:
|
||||
with support.catch_unraisable_exception() as cm:
|
||||
atexit._run_exitfuncs()
|
||||
self.assertEqual(cm.unraisable.object, func)
|
||||
self.assertIsNone(cm.unraisable.object)
|
||||
self.assertEqual(cm.unraisable.err_msg,
|
||||
f'Exception ignored in atexit callback {func!r}')
|
||||
self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError)
|
||||
self.assertEqual(type(cm.unraisable.exc_value), ZeroDivisionError)
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue