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.
from test.test_support import TESTFN, vereq
from test.test_support import TESTFN, vereq, is_jython
import atexit
from os import popen, unlink
import sys
executable = sys.executable
if is_jython:
executable = "jython"
input = """\
import atexit
@ -23,7 +27,7 @@ f = file(fname, "w")
f.write(input)
f.close()
p = popen("%s %s" % (sys.executable, fname))
p = popen("%s %s" % (executable, fname))
output = p.read()
p.close()
vereq(output, """\
@ -51,7 +55,7 @@ f = file(fname, "w")
f.write(input)
f.close()
p = popen("%s %s" % (sys.executable, fname))
p = popen("%s %s" % (executable, fname))
output = p.read()
p.close()
vereq(output, """\