[Python-checkins] cpython (merge 3.6 -> default): Issue #28732: Adds new errors to spawnv emulation for platforms that only have

steve.dower python-checkins at python.org
Sat Nov 19 23:12:20 EST 2016


https://hg.python.org/cpython/rev/ac6de11fbd50
changeset:   105200:ac6de11fbd50
parent:      105198:fc6f757e53de
parent:      105199:2e1fb851dfb4
user:        Steve Dower <steve.dower at microsoft.com>
date:        Sat Nov 19 20:12:08 2016 -0800
summary:
  Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork and execv

files:
  Lib/os.py |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/os.py b/Lib/os.py
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -832,6 +832,10 @@
 
     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

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list