diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-11-19 20:11:56 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-11-19 20:11:56 -0800 |
commit | eccaa0679dfd8f23473b3370b74be4af1b5fec44 (patch) | |
tree | 16873747eb90a7995f09cb4cbb8e0bfdfe73f73b /Lib/os.py | |
parent | Issue #28732: Raise ValueError when argv[0] is empty (diff) | |
download | cpython-eccaa0679dfd8f23473b3370b74be4af1b5fec44.tar.gz cpython-eccaa0679dfd8f23473b3370b74be4af1b5fec44.tar.bz2 cpython-eccaa0679dfd8f23473b3370b74be4af1b5fec44.zip |
Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork and execv
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/os.py b/Lib/os.py index 71ed0885b0c..a704fb218c3 100644 --- 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 |