diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-11-02 11:16:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 09:16:34 +0000 |
commit | 970e719a7a829bddc647bbaa668dd8603abdddef (patch) | |
tree | 92eeeba01687f6e02482315db653ce57f3b10e4b /Lib/test/test_cmd_line.py | |
parent | a12f624a9dc1c44bb20a20b13fd164c14b987892 (diff) | |
download | cpython-970e719a7a829bddc647bbaa668dd8603abdddef.tar.gz cpython-970e719a7a829bddc647bbaa668dd8603abdddef.zip |
gh-108082: Use PyErr_FormatUnraisable() (GH-111580)
Replace most of calls of _PyErr_WriteUnraisableMsg() and some
calls of PyErr_WriteUnraisable(NULL) with PyErr_FormatUnraisable().
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 2e57e4e5b49..7a27952c345 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -479,8 +479,9 @@ class CmdLineTest(unittest.TestCase): rc, out, err = assert_python_failure('-c', code) self.assertEqual(b'', out) self.assertEqual(120, rc) - self.assertRegex(err.decode('ascii', 'ignore'), - 'Exception ignored in.*\nOSError: .*') + self.assertIn(b'Exception ignored on flushing sys.stdout:\n' + b'OSError: '.replace(b'\n', os.linesep.encode()), + err) def test_closed_stdout(self): # Issue #13444: if stdout has been explicitly closed, we should |