gh-129354: Use PyErr_FormatUnraisable() function (#129523)

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

Update tests:

* test_coroutines
* test_exceptions
* test_generators
* test_struct
This commit is contained in:
Victor Stinner 2025-02-05 11:31:59 +01:00 committed by GitHub
parent dc804ffb2f
commit a25042e6d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 42 additions and 17 deletions

View file

@ -694,7 +694,7 @@ class StructTest(ComplexesAreIdenticalMixin, unittest.TestCase):
rc, stdout, stderr = assert_python_ok("-c", code)
self.assertEqual(rc, 0)
self.assertEqual(stdout.rstrip(), b"")
self.assertIn(b"Exception ignored in:", stderr)
self.assertIn(b"Exception ignored while calling deallocator", stderr)
self.assertIn(b"C.__del__", stderr)
def test__struct_reference_cycle_cleaned_up(self):