mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Make the test pass for jython where there are no sys.executable.
This commit is contained in:
parent
5a231c8f79
commit
41c570f2e7
1 changed files with 7 additions and 3 deletions
|
|
@ -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, """\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue