Skip to content

Commit d7ea32c

Browse files
authored
Merge pull request RustPython#1238 from youknowone/macos-stdlib-subprocess
Fix stdlib_subprocess for macOS
2 parents e0431c0 + 36c263f commit d7ea32c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/snippets/stdlib_subprocess.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
p = subprocess.Popen(["echo", "test"], stdout=subprocess.PIPE)
2929
p.wait()
3030

31-
if "win" not in sys.platform:
31+
is_unix = "win" not in sys.platform or "darwin" in sys.platform
32+
33+
if is_unix:
3234
# unix
3335
test_output = b"test\n"
3436
else:
@@ -40,15 +42,15 @@
4042
p = subprocess.Popen(["sleep", "2"])
4143
p.terminate()
4244
p.wait()
43-
if "win" not in sys.platform:
45+
if is_unix:
4446
assert p.returncode == -signal.SIGTERM
4547
else:
4648
assert p.returncode == 1
4749

4850
p = subprocess.Popen(["sleep", "2"])
4951
p.kill()
5052
p.wait()
51-
if "win" not in sys.platform:
53+
if is_unix:
5254
assert p.returncode == -signal.SIGKILL
5355
else:
5456
assert p.returncode == 1

0 commit comments

Comments
 (0)