diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 59fe1e4c08..9cadd1bf8e 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -345,8 +345,6 @@ def _args_from_interpreter_flags(): # -X options if dev_mode: args.extend(('-X', 'dev')) - if sys.flags.nogil: - args.extend(('-X', 'nogil')) for opt in ('faulthandler', 'tracemalloc', 'importtime', 'showrefcount', 'utf8'): if opt in xoptions: diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index b317f7883c..5469af3e86 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -247,7 +247,7 @@ def test_return_null_without_error(self): r'SystemError: ' r'returned NULL without setting an exception\n' r'\n' - r'Current thread.*:\n' + r'Stack.*:\n' r' File .*", line 6 in \n') else: with self.assertRaises(SystemError) as cm: @@ -281,7 +281,7 @@ def test_return_result_with_error(self): r'function return_result_with_error> ' r'returned a result with an exception set\n' r'\n' - r'Current thread.*:\n' + r'Stack.*:\n' r' File .*, line 6 in \n') else: with self.assertRaises(SystemError) as cm: diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 198186cddf..1ec8a55ff1 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -485,9 +485,11 @@ def test_cancel_futures_wait_false(self): rc, out, err = assert_python_ok('-c', """if True: from concurrent.futures import ThreadPoolExecutor from test.test_concurrent_futures import sleep_and_print + import time if __name__ == "__main__": t = ThreadPoolExecutor() t.submit(sleep_and_print, .1, "apple") + time.sleep(0.01) # wait for thread to start sleep_and_print t.shutdown(wait=False, cancel_futures=True) """) # Errors in atexit hooks don't change the process exit code, check diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index fc8bd30792..054676309e 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -427,7 +427,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): use_environment=0, utf8_mode=0, dev_mode=0, - disable_gil=0, + disable_gil=1, coerce_c_locale=0, ) @@ -443,7 +443,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'isolated': 0, 'use_environment': 1, 'dev_mode': 0, - 'disable_gil': 0, + 'disable_gil': 1, 'install_signal_handlers': 1, 'use_hash_seed': 0, diff --git a/Python/initconfig.c b/Python/initconfig.c index 856f1f09c2..a780e977dd 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -866,7 +866,7 @@ PyConfig_InitIsolatedConfig(PyConfig *config) config->use_environment = 0; config->user_site_directory = 0; config->dev_mode = 0; - config->disable_gil = 0; + config->disable_gil = 1; config->install_signal_handlers = 0; config->use_hash_seed = 0; config->faulthandler = 0; diff --git a/Python/preconfig.c b/Python/preconfig.c index 9bcae4219d..7d4c5f07c8 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -280,7 +280,7 @@ _PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig) cmdline->disable_gil = (strcmp(env, "0") == 0); } else { - cmdline->disable_gil = 0; + cmdline->disable_gil = 1; } }