]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixes empty tuple case.
authorSteve Dower <steve.dower@microsoft.com>
Sun, 20 Nov 2016 05:14:27 +0000 (21:14 -0800)
committerSteve Dower <steve.dower@microsoft.com>
Sun, 20 Nov 2016 05:14:27 +0000 (21:14 -0800)
Lib/os.py

index a704fb218c3a720299e82cf5b18e4d32d8919536..fa06f3937ba5051c73061785714a36926b7443ab 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -834,7 +834,7 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
         # 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]:
+        if not args or not args[0]:
             raise ValueError('argv first element cannot be empty')
         pid = fork()
         if not pid: