From bb08db4010a45bcd96f6aaf47dbaed5a1c2b3729 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Sat, 19 Nov 2016 21:14:27 -0800 Subject: Fixes empty tuple case. --- Lib/os.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/os.py b/Lib/os.py index a704fb2..fa06f39 100644 --- 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: -- cgit v0.12