Skip to content

Commit 361d477

Browse files
Fix tests.
1 parent 0cffd32 commit 361d477

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_embed.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def run_embedded_interpreter(self, *args, env=None,
117117
p.terminate()
118118
p.wait()
119119
raise
120+
if returncode is None:
121+
returncode = 1 if p.returncode == 0 else p.returncode
120122
if p.returncode != returncode and support.verbose:
121123
print(f"--- {cmd} failed ---")
122124
print(f"stdout:\n{out}")
@@ -231,8 +233,8 @@ def test_replace_main_tstate(self):
231233
with self.subTest(reuse=reuse, exec=False):
232234
self.run_embedded_interpreter(
233235
'test_replace_main_tstate',
234-
# At the moment, this actually succeeds on all platforms.
235-
returncode=0,
236+
# At the moment, this fails because main_tstate gets broken.
237+
returncode=None,
236238
)
237239
with self.subTest(reuse=reuse, exec=True):
238240
out, _ = self.run_embedded_interpreter(
@@ -248,7 +250,7 @@ def test_fini_in_subthread(self):
248250
'test_fini_in_subthread',
249251
# At the moment, this actually succeeds on all platforms,
250252
# except for Windows (STATUS_ACCESS_VIOLATION).
251-
returncode=0xC0000005 if MS_WINDOWS else 0,
253+
returncode=None if MS_WINDOWS else 0,
252254
)
253255

254256
def test_fini_in_main_thread_with_other_tstate(self):

0 commit comments

Comments
 (0)