summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-07-27 07:42:43 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-07-27 07:42:43 (GMT)
commit9407e553c045e0fa1e3d5f2b35912f62f5e9bca5 (patch)
tree671f469423b48de7fdfc7e3c34dae490466fcf8c /Lib
parentae0965eb2323bea3704f298c830837096484be4e (diff)
downloadcpython-9407e553c045e0fa1e3d5f2b35912f62f5e9bca5.zip
cpython-9407e553c045e0fa1e3d5f2b35912f62f5e9bca5.tar.gz
cpython-9407e553c045e0fa1e3d5f2b35912f62f5e9bca5.tar.bz2
-- changed test to work on platforms which have os.popen
but no os.fork
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_popen2.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_popen2.py b/Lib/test/test_popen2.py
index be79f3c..f6359ce 100644
--- a/Lib/test/test_popen2.py
+++ b/Lib/test/test_popen2.py
@@ -5,11 +5,17 @@
# popen2 contains its own testing routine
# which is especially useful to see if open files
-# like stdin can be read successfully by a forked
+# like stdin can be read successfully by a forked
# subprocess.
def main():
- from os import fork # skips test through ImportError
+ try:
+ from os import popen
+ except ImportError:
+ # if we don't have os.popen, check that
+ # we have os.fork. if not, skip the test
+ # (by raising an ImportError)
+ from os import fork
import popen2
popen2._test()