]> granicus.if.org Git - python/commitdiff
Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork...
authorSteve Dower <steve.dower@microsoft.com>
Sun, 20 Nov 2016 04:11:56 +0000 (20:11 -0800)
committerSteve Dower <steve.dower@microsoft.com>
Sun, 20 Nov 2016 04:11:56 +0000 (20:11 -0800)
Lib/os.py

index 71ed0885b0ceabceadfbf7586eeb4dffb285ec86..a704fb218c3a720299e82cf5b18e4d32d8919536 100644 (file)
--- 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