Closed
Description
Example on Windows:
import subprocess
program = r"PCbuild\amd64\_testembed_d.exe"
cmd = [program, "test_repeated_init_exec", "import _ctypes"]
for i in range(1, 11):
print(f" == Process #{i} ===")
proc = subprocess.run(cmd)
exitcode = proc.returncode
print(f"=> exitcode {exitcode}")
if exitcode:
break
print()
Output:
vstinner@WIN C:\victor\python\main>python bug.py
Running Debug|x64 interpreter...
== Process #1 ===
--- Loop #1 ---
--- Loop #2 ---
--- Loop #3 ---
--- Loop #4 ---
=> exitcode 0
== Process #2 ===
--- Loop #1 ---
--- Loop #2 ---
Assertion failed: PyUnicode_CheckExact(ep->me_key), file C:\victor\python\main\Objects\dictobject.c, line 922
=> exitcode 3