Reorganized so the test is skipped if os.popen() doesn't exist (in stead of failing).

This commit is contained in:
Jack Jansen 2002-07-26 11:33:49 +00:00
parent c7554e28ee
commit aeb6a60e03
1 changed files with 4 additions and 4 deletions

View File

@ -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 @@ def handler2(*args, **kargs):
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 @@ def indirect():
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 @@ def indirect():
direct exit
""")
os.unlink(fname)
unlink(fname)