Skip to content

Commit

Permalink
Tests: os.execv -> sys.exit(subprocess.call()). (#2692)
Browse files Browse the repository at this point in the history
To accommodate Windows.

More work towards #2658.
  • Loading branch information
jsirois authored Feb 21, 2025
1 parent 6c2421c commit 5cce378
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ def test_unzip_mode(tmpdir):
dedent(
"""\
import os
import subprocess
import sys
if 'quit' == sys.argv[-1]:
Expand All @@ -1486,7 +1487,7 @@ def test_unzip_mode(tmpdir):
print(' '.join(sys.argv[1:]))
sys.stdout.flush()
sys.stderr.flush()
os.execv(sys.executable, [sys.executable] + sys.argv[:-1])
sys.exit(subprocess.call([sys.executable] + sys.argv[:-1]))
"""
)
)
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/venv_ITs/test_issue_2065.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_venv_pex_script_non_hermetic(
dedent(
"""\
import os
import subprocess
import sys
def run():
Expand All @@ -45,7 +46,7 @@ def run():
pythonpath.extend(existing_pythonpath.split(os.pathsep))
os.environ["PYTHONPATH"] = os.pathsep.join(pythonpath)
os.execv(sys.argv[1], sys.argv[1:])
sys.exit(subprocess.call(sys.argv[1:]))
"""
)
)
Expand Down

0 comments on commit 5cce378

Please sign in to comment.