summaryrefslogtreecommitdiffstats
path: root/Programs
diff options
context:
space:
mode:
authorluk1337 <priv.luk@gmail.com>2024-09-19 16:05:20 (GMT)
committerGitHub <noreply@github.com>2024-09-19 16:05:20 (GMT)
commit7331d0f70bc9fbac177b76b6ec03486430383425 (patch)
tree3d2a3a6f00a059e154d7defe40a2ddd17d5aba7c /Programs
parent8f82d9aa2191db7826bb7a453fe06ce65f966cf8 (diff)
downloadcpython-7331d0f70bc9fbac177b76b6ec03486430383425.zip
cpython-7331d0f70bc9fbac177b76b6ec03486430383425.tar.gz
cpython-7331d0f70bc9fbac177b76b6ec03486430383425.tar.bz2
gh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_testembed.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 342cc91..10ee6b7 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -95,6 +95,14 @@ static void _testembed_Py_Initialize(void)
}
+static int test_import_in_subinterpreters(void)
+{
+ _testembed_Py_InitializeFromConfig();
+ PyThreadState_Swap(Py_NewInterpreter());
+ return PyRun_SimpleString("import readline"); // gh-124160
+}
+
+
/*****************************************************
* Test repeated initialisation and subinterpreters
*****************************************************/
@@ -2398,6 +2406,7 @@ static struct TestCase TestCases[] = {
{"test_repeated_init_exec", test_repeated_init_exec},
{"test_repeated_simple_init", test_repeated_simple_init},
{"test_forced_io_encoding", test_forced_io_encoding},
+ {"test_import_in_subinterpreters", test_import_in_subinterpreters},
{"test_repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters},
{"test_repeated_init_and_inittab", test_repeated_init_and_inittab},
{"test_pre_initialization_api", test_pre_initialization_api},