Make the test pass for jython where there are no sys.executable.
This commit is contained in:
parent
5a231c8f79
commit
41c570f2e7
|
@ -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, """\
|
||||||
|
|
Loading…
Reference in New Issue