summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-11-20 04:12:08 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-11-20 04:12:08 (GMT)
commitb8f4c7a779201c267ba12efdfe2ddd1d8774ff16 (patch)
treee948f72511edcab0002b5dd7ea98717104ac544f
parent83aeb3cc80326c439ce3cf298439e667d2b8eb4c (diff)
parenteccaa0679dfd8f23473b3370b74be4af1b5fec44 (diff)
downloadcpython-b8f4c7a779201c267ba12efdfe2ddd1d8774ff16.zip
cpython-b8f4c7a779201c267ba12efdfe2ddd1d8774ff16.tar.gz
cpython-b8f4c7a779201c267ba12efdfe2ddd1d8774ff16.tar.bz2
Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork and execv
-rw-r--r--Lib/os.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 71ed088..a704fb2 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -832,6 +832,10 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
def _spawnvef(mode, file, args, env, func):
# Internal helper; func is the exec*() function to use
+ if not isinstance(args, (tuple, list)):
+ raise TypeError('argv must be a tuple or a list')
+ if not args[0]:
+ raise ValueError('argv first element cannot be empty')
pid = fork()
if not pid:
# Child