Skip to content

Commit

Permalink
Fix the test script to be compatible with older Pythons
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore committed Sep 17, 2022
1 parent 85cdef6 commit dc01b59
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scripts/check_zipapp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import subprocess
import sys

proc = subprocess.run(
# This code needs to support all versions of Python we test against
proc = subprocess.Popen(
[sys.executable] + sys.argv[1:],
capture_output=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
proc.wait()

if proc.returncode != 0:
assert b"does not support python" in proc.stderr
out = proc.stdout.read()
err = proc.stderr.read()

if proc.returncode == 0:
print(out)
elif b"does not support python" in err:
print(err)
else:
print(err)
raise SystemExit("Failed")

0 comments on commit dc01b59

Please sign in to comment.