From: Fredrik Lundh Date: Thu, 27 Jul 2000 07:42:43 +0000 (+0000) Subject: -- changed test to work on platforms which have os.popen X-Git-Tag: v2.0b1~704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9407e553c045e0fa1e3d5f2b35912f62f5e9bca5;p=python -- changed test to work on platforms which have os.popen but no os.fork --- diff --git a/Lib/test/test_popen2.py b/Lib/test/test_popen2.py index be79f3c6ab..f6359ce2eb 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()