summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-08-28 17:20:05 (GMT)
committerFred Drake <fdrake@acm.org>2000-08-28 17:20:05 (GMT)
commit31f182e830db13c3edbe12e58f9c737cc21583fa (patch)
tree6138744d553c71b9eef48a43bc8a4ab201c5f9c3 /Lib/os.py
parente67d8e514f7d7b49faec3e5a181c7019f07467ba (diff)
downloadcpython-31f182e830db13c3edbe12e58f9c737cc21583fa.zip
cpython-31f182e830db13c3edbe12e58f9c737cc21583fa.tar.gz
cpython-31f182e830db13c3edbe12e58f9c737cc21583fa.tar.bz2
Added os.popen2() and os.popen3() for non-Windows platforms.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 59c3895..c804c3a 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -454,3 +454,16 @@ otherwise return -SIG, where SIG is the signal that killed it. """
return spawnvpe(mode, file, args[:-1], env)
+if not _exists("popen2"):
+ def popen2(cmd, mode="t", bufsize=-1):
+ assert mode[:1] in ("b", "t")
+ import popen2
+ stdout, stdin = popen2.popen2(cmd, bufsize)
+ return stdin, stdout
+
+if not _exists("popen3"):
+ def popen3(cmd, mode="t", bufsize=-1):
+ assert mode[:1] in ("b", "t")
+ import popen2
+ stdout, stdin, stderr = popen2.popen3(cmd, bufsize)
+ return stdin, stdout, stderr