Make the test pass for jython where there are no sys.executable.

This commit is contained in:
Finn Bock 2002-11-06 11:37:57 +00:00
parent 5a231c8f79
commit 41c570f2e7
1 changed files with 7 additions and 3 deletions

View File

@ -1,9 +1,13 @@
# Test the atexit module. # Test the atexit module.
from test.test_support import TESTFN, vereq from test.test_support import TESTFN, vereq, is_jython
import atexit import atexit
from os import popen, unlink from os import popen, unlink
import sys import sys
executable = sys.executable
if is_jython:
executable = "jython"
input = """\ input = """\
import atexit import atexit
@ -23,7 +27,7 @@ f = file(fname, "w")
f.write(input) f.write(input)
f.close() f.close()
p = popen("%s %s" % (sys.executable, fname)) p = popen("%s %s" % (executable, fname))
output = p.read() output = p.read()
p.close() p.close()
vereq(output, """\ vereq(output, """\
@ -51,7 +55,7 @@ f = file(fname, "w")
f.write(input) f.write(input)
f.close() f.close()
p = popen("%s %s" % (sys.executable, fname)) p = popen("%s %s" % (executable, fname))
output = p.read() output = p.read()
p.close() p.close()
vereq(output, """\ vereq(output, """\