Issue #28732: Adds new errors to spawnv emulation for platforms that only have fork and execv

This commit is contained in:
Steve Dower 2016-11-19 20:11:56 -08:00
parent bce26262d1
commit eccaa0679d
1 changed files with 4 additions and 0 deletions

View File

@ -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