diff --git a/Lib/test/exception_hierarchy.txt b/Lib/test/exception_hierarchy.txt index 1eca123be..f2649aa2d 100644 --- a/Lib/test/exception_hierarchy.txt +++ b/Lib/test/exception_hierarchy.txt @@ -40,6 +40,7 @@ BaseException ├── ReferenceError ├── RuntimeError │ ├── NotImplementedError + │ ├── PythonFinalizationError │ └── RecursionError ├── StopAsyncIteration ├── StopIteration diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index cf0268c2c..13b0d4a2a 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -2696,6 +2696,7 @@ class PtyTests(unittest.TestCase): else: yield + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux def test_input_tty(self): # Test input() functionality when wired to a tty self.check_input_tty("prompt", b"quux") @@ -2710,17 +2711,20 @@ class PtyTests(unittest.TestCase): # Check stdin/stdout error handler is used when invoking PyOS_Readline() self.check_input_tty("prompté", b"quux\xe9", "ascii") + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux def test_input_tty_null_in_prompt(self): self.check_input_tty("prompt\0", b"", expected='ValueError: input: prompt string cannot contain ' 'null characters') + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux def test_input_tty_nonencodable_prompt(self): self.check_input_tty("prompté", b"quux", "ascii", stdout_errors='strict', expected="UnicodeEncodeError: 'ascii' codec can't encode " "character '\\xe9' in position 6: ordinal not in " "range(128)") + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux def test_input_tty_nondecodable_input(self): self.check_input_tty("prompt", b"quux\xe9", "ascii", stdin_errors='strict', expected="UnicodeDecodeError: 'ascii' codec can't decode " diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index c9d4a3484..bfb0c1733 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -775,7 +775,6 @@ class CompatPickleTests(unittest.TestCase): module, name = mapping(module, name) self.assertEqual((module, name), (module3, name3)) - @unittest.expectedFailure # TODO: RUSTPYTHON def test_exceptions(self): self.assertEqual(mapping('exceptions', 'StandardError'), ('builtins', 'Exception')) diff --git a/crates/vm/src/stdlib/builtins.rs b/crates/vm/src/stdlib/builtins.rs index f2d4dcdb6..403e8c12e 100644 --- a/crates/vm/src/stdlib/builtins.rs +++ b/crates/vm/src/stdlib/builtins.rs @@ -1474,6 +1474,7 @@ pub fn init_module(vm: &VirtualMachine, module: &Py) { "TimeoutError" => ctx.exceptions.timeout_error.to_owned(), "ReferenceError" => ctx.exceptions.reference_error.to_owned(), "RuntimeError" => ctx.exceptions.runtime_error.to_owned(), + "PythonFinalizationError" => ctx.exceptions.python_finalization_error.to_owned(), "NotImplementedError" => ctx.exceptions.not_implemented_error.to_owned(), "RecursionError" => ctx.exceptions.recursion_error.to_owned(), "SyntaxError" => ctx.exceptions.syntax_error.to_owned(),