Commit aeb6a60e authored by Jack Jansen's avatar Jack Jansen

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

parent c7554e28
# Test the atexit module. # Test the atexit module.
from test_support import TESTFN, vereq from test_support import TESTFN, vereq
import atexit import atexit
import os from os import popen, unlink
import sys import sys
input = """\ input = """\
...@@ -23,7 +23,7 @@ f = file(fname, "w") ...@@ -23,7 +23,7 @@ f = file(fname, "w")
f.write(input) f.write(input)
f.close() f.close()
p = os.popen("%s %s" % (sys.executable, fname)) p = popen("%s %s" % (sys.executable, fname))
output = p.read() output = p.read()
p.close() p.close()
vereq(output, """\ vereq(output, """\
...@@ -51,7 +51,7 @@ f = file(fname, "w") ...@@ -51,7 +51,7 @@ f = file(fname, "w")
f.write(input) f.write(input)
f.close() f.close()
p = os.popen("%s %s" % (sys.executable, fname)) p = popen("%s %s" % (sys.executable, fname))
output = p.read() output = p.read()
p.close() p.close()
vereq(output, """\ vereq(output, """\
...@@ -59,4 +59,4 @@ indirect exit ...@@ -59,4 +59,4 @@ indirect exit
direct exit direct exit
""") """)
os.unlink(fname) unlink(fname)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment