[Python-checkins] cpython (3.6): Fixes empty tuple case.

steve.dower python-checkins at python.org
Sun Nov 20 00:40:09 EST 2016


https://hg.python.org/cpython/rev/1923556eb13f
changeset:   105201:1923556eb13f
branch:      3.6
parent:      105199:2e1fb851dfb4
user:        Steve Dower <steve.dower at microsoft.com>
date:        Sat Nov 19 21:14:27 2016 -0800
summary:
  Fixes empty tuple case.

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


diff --git a/Lib/os.py b/Lib/os.py
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -834,7 +834,7 @@
         # 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:

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


More information about the Python-checkins mailing list