]> granicus.if.org Git - python/commitdiff
Oops. spawnl() and spawnle() should be implemented on Windows too.
authorGuido van Rossum <guido@python.org>
Tue, 2 Nov 1999 20:44:07 +0000 (20:44 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 2 Nov 1999 20:44:07 +0000 (20:44 +0000)
Also added a comment that the 'p' variants (spawnvp() etc.) are *not*
supported on Windows.  (They could be by adding them to posixmodule.c)

Lib/os.py

index 8836dd362fa38b2e280c44cf998a50d9b065140d..057c101095c889dd2cf8728dc702d1373f775a1e 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -330,7 +330,17 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
     def spawnve(mode, file, args, env):
         return _spawnvef(mode, file, args, env, execve)
 
-    # Supply the various other variants
+    # Note: spawnvp[e] is't currently supported on Windows
+
+    def spawnvp(mode, file, args):
+        return _spawnvef(mode, file, args, None, execvp)
+
+    def spawnvpe(mode, file, args, env):
+        return _spawnvef(mode, file, args, env, execvpe)
+
+if _exists("spawnv"):
+    # These aren't supplied by the basic Windows code
+    # but can be easily implemented in Python
 
     def spawnl(mode, file, *args):
         return spawnv(mode, file, args)
@@ -339,15 +349,12 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
         env = args[-1]
         return spawnve(mode, file, args[:-1], env)
 
+if _exists("spawnvp"):
+    # At the moment, Windows doesn't implement spawnvp[e],
+    # so it won't have spawnlp[e] either.
     def spawnlp(mode, file, *args):
         return spawnvp(mode, file, args)
 
     def spawnlpe(mode, file, *args):
         env = args[-1]
         return spawnvpe(mode, file, args[:-1], env)
-
-    def spawnvp(mode, file, args):
-        return _spawnvef(mode, file, args, None, execvp)
-
-    def spawnvpe(mode, file, args, env):
-        return _spawnvef(mode, file, args, env, execvpe)