We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af1022a commit 2fb8419Copy full SHA for 2fb8419
1 file changed
Programs/_testembed.c
@@ -2738,12 +2738,14 @@ test_thread_state_ensure(void)
2738
static int
2739
test_main_interpreter_view(void)
2740
{
2741
- assert(PyInterpreterView_FromMain() == NULL);
2742
- _testembed_initialize();
2743
-
2744
- // Main interpreter is initialized and ready.
2745
PyInterpreterView *view = PyInterpreterView_FromMain();
2746
assert(view != NULL);
+ // These should fail -- the main interpreter is not available yet.
+ assert(PyInterpreterGuard_FromView(view) == NULL);
+ assert(PyThreadState_EnsureFromView(view) == NULL);
+
2747
+ _testembed_initialize();
2748
+ // Main interpreter is initialized and ready at this point.
2749
2750
PyInterpreterGuard *guard = PyInterpreterGuard_FromView(view);
2751
assert(guard != NULL);
0 commit comments