From f0db8329be8f22ee75668f17f86e78a2fa4fa5cf Mon Sep 17 00:00:00 2001 From: Ankit Kumar Pandey <93041495+itsankitkp@users.noreply.github.com> Date: Sat, 22 Apr 2023 01:52:18 +0530 Subject: [PATCH] rename os module's exit function to _exit as thats how it is defined in cpython (#4887) --- Lib/test/test_importlib/test_threaded_import.py | 2 ++ vm/src/stdlib/os.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index c13195218..49c02484b 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -6,6 +6,7 @@ # randrange, and then Python hangs. import _imp as imp +import _multiprocessing # TODO: RUSTPYTHON import os import importlib import sys @@ -260,6 +261,7 @@ class ThreadedImportTests(unittest.TestCase): 'partial', 'cfimport.py') script_helper.assert_python_ok(fn) + @unittest.skipUnless(hasattr(_multiprocessing, "SemLock"), "TODO: RUSTPYTHON, pool_in_threads.py needs _multiprocessing.SemLock") @unittest.expectedFailureIfWindows("TODO: RUSTPYTHON") def test_multiprocessing_pool_circular_import(self): # Regression test for bpo-41567 diff --git a/vm/src/stdlib/os.rs b/vm/src/stdlib/os.rs index 0c6fcfd8e..d03e40261 100644 --- a/vm/src/stdlib/os.rs +++ b/vm/src/stdlib/os.rs @@ -1167,7 +1167,7 @@ pub(super) mod _os { } #[pyfunction] - fn exit(code: i32) { + fn _exit(code: i32) { std::process::exit(code) }