[Python-checkins] python/dist/src/Lib/test test_atexit.py,1.3.24.3,1.3.24.4

bckfnn@users.sourceforge.net bckfnn@users.sourceforge.net
Wed, 06 Nov 2002 03:41:51 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv14524

Modified Files:
      Tag: release22-maint
	test_atexit.py 
Log Message:
Backport 1.8->1.9: Make the test pass for jython where there are no
sys.executable.



Index: test_atexit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_atexit.py,v
retrieving revision 1.3.24.3
retrieving revision 1.3.24.4
diff -C2 -d -r1.3.24.3 -r1.3.24.4
*** test_atexit.py	10 Oct 2002 20:46:33 -0000	1.3.24.3
--- test_atexit.py	6 Nov 2002 11:41:48 -0000	1.3.24.4
***************
*** 1,8 ****
  # Test the atexit module.
! from test_support import TESTFN, vereq
  import atexit
  from os import popen, unlink
  import sys
  
  input = """\
  import atexit
--- 1,12 ----
  # Test the atexit module.
! from 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
***************
*** 24,28 ****
  f.close()
  
! p = popen("%s %s" % (sys.executable, fname))
  output = p.read()
  p.close()
--- 28,32 ----
  f.close()
  
! p = popen("%s %s" % (executable, fname))
  output = p.read()
  p.close()
***************
*** 52,56 ****
  f.close()
  
! p = popen("%s %s" % (sys.executable, fname))
  output = p.read()
  p.close()
--- 56,60 ----
  f.close()
  
! p = popen("%s %s" % (executable, fname))
  output = p.read()
  p.close()