Skip to content

Commit 2fb8419

Browse files
committed
Fix test_embed.
1 parent af1022a commit 2fb8419

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Programs/_testembed.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,12 +2738,14 @@ test_thread_state_ensure(void)
27382738
static int
27392739
test_main_interpreter_view(void)
27402740
{
2741-
assert(PyInterpreterView_FromMain() == NULL);
2742-
_testembed_initialize();
2743-
2744-
// Main interpreter is initialized and ready.
27452741
PyInterpreterView *view = PyInterpreterView_FromMain();
27462742
assert(view != NULL);
2743+
// These should fail -- the main interpreter is not available yet.
2744+
assert(PyInterpreterGuard_FromView(view) == NULL);
2745+
assert(PyThreadState_EnsureFromView(view) == NULL);
2746+
2747+
_testembed_initialize();
2748+
// Main interpreter is initialized and ready at this point.
27472749

27482750
PyInterpreterGuard *guard = PyInterpreterGuard_FromView(view);
27492751
assert(guard != NULL);

0 commit comments

Comments
 (0)