Skip to content

Commit 6c953b3

Browse files
committed
Minor tweak to subprocess error message.
1 parent 7513ff6 commit 6c953b3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ diff/*
88
dist/*
99
.envrc
1010
.vscode/
11-
local/*
11+
local/*
12+
*.dist-info
13+
__pycache__
14+
tests/testbed/iOS
15+
tests/testbed/macOS

patch/Python/Python.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ index 66a16a6839..dd6444892d 100644
723723
+ _CASE_INSENSITIVE_PLATFORMS_STR_KEY)
724724

725725
diff --git a/Lib/os.py b/Lib/os.py
726-
index 9853e37c61..7d569e55d5 100644
726+
index 9853e37c61..cabea71cca 100644
727727
--- a/Lib/os.py
728728
+++ b/Lib/os.py
729729
@@ -34,7 +34,7 @@
@@ -740,7 +740,7 @@ index 9853e37c61..7d569e55d5 100644
740740
del _fscodec
741741

742742
+
743-
+if sys.platform in ('iOS', 'tvos', 'watchos'):
743+
+if sys.platform in ('ios', 'tvos', 'watchos'):
744744
+ allows_subprocesses = False
745745
+else:
746746
+ allows_subprocesses = True
@@ -11421,15 +11421,15 @@ index 878658827c..0bc557f9e0 100644
1142111421
return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
1142211422

1142311423
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
11424-
index 3f99be551c..447fd60f35 100644
11424+
index 3f99be551c..6a4ad34d5c 100644
1142511425
--- a/Lib/subprocess.py
1142611426
+++ b/Lib/subprocess.py
1142711427
@@ -686,6 +686,9 @@
1142811428
restore_signals=True, start_new_session=False,
1142911429
pass_fds=(), *, encoding=None, errors=None, text=None):
1143011430
"""Create new Popen instance."""
1143111431
+ if not os.allows_subprocesses:
11432-
+ raise RuntimeError("Subprocesses are not supported on this platform.")
11432+
+ raise RuntimeError(f"Subprocesses are not supported on {sys.platform}")
1143311433
+
1143411434
_cleanup()
1143511435
# Held while anything is calling waitpid before returncode has been

0 commit comments

Comments
 (0)