From: Jack Jansen Date: Thu, 10 Oct 2002 20:46:33 +0000 (+0000) Subject: Backport of 1.7: X-Git-Tag: v2.2.2~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db48b27bfb073042227eee967a7c9074082eff42;p=thirdparty%2FPython%2Fcpython.git Backport of 1.7: Reorganized so the test is skipped if os.popen() doesn't exist (in stead of fail ing). --- diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py index 64c4c3c68d70..9b93b6815b56 100644 --- a/Lib/test/test_atexit.py +++ b/Lib/test/test_atexit.py @@ -1,7 +1,7 @@ # Test the atexit module. from test_support import TESTFN, vereq import atexit -import os +from os import popen, unlink import sys input = """\ @@ -23,7 +23,7 @@ f = file(fname, "w") f.write(input) f.close() -p = os.popen("%s %s" % (sys.executable, fname)) +p = popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() vereq(output, """\ @@ -51,7 +51,7 @@ f = file(fname, "w") f.write(input) f.close() -p = os.popen("%s %s" % (sys.executable, fname)) +p = popen("%s %s" % (sys.executable, fname)) output = p.read() p.close() vereq(output, """\ @@ -59,4 +59,4 @@ indirect exit direct exit """) -os.unlink(fname) +unlink(fname)