Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79712c9

Browse files
gh-91916: Fix test_runpy on non-UTF-8 locale (GH-91920)
If use a non-builtin codec, partially implemented in Python (e.g. ISO-8859-15), a new RecursionError (with empty error message) can be raised while handle a RecursionError. Testing for error message was needed to distinguish a recursion error from arbitrary RuntimeError. After introducing RecursionError, it became unnecessary. (cherry picked from commit a568585) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 4120bba commit 79712c9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/test/test_runpy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,7 @@ def test_main_recursion_error(self):
740740
"runpy.run_path(%r)\n") % dummy_dir
741741
script_name = self._make_test_script(script_dir, mod_name, source)
742742
zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
743-
msg = "recursion depth exceeded"
744-
self.assertRaisesRegex(RecursionError, msg, run_path, zip_name)
743+
self.assertRaises(RecursionError, run_path, zip_name)
745744

746745
def test_encoding(self):
747746
with temp_dir() as script_dir:

0 commit comments

Comments
 (0)