[Python-checkins] python/dist/src/Lib/test test_import.py,1.13,1.14

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Fri, 14 Jun 2002 22:14:07 -0700


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

Modified Files:
	test_import.py 
Log Message:
test_module_with_large_stack():  This failed when Python was run with -O,
trying to delete a .pyc file that didn't exist (it needed to delete .pyo
then).


Index: test_import.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** test_import.py	15 Jun 2002 05:00:42 -0000	1.13
--- test_import.py	15 Jun 2002 05:14:05 -0000	1.14
***************
*** 89,93 ****
      f.close()
  
!     # compile & remove .py file, we only need .pyc
      f = open(filename, 'r')
      py_compile.compile(filename)
--- 89,93 ----
      f.close()
  
!     # compile & remove .py file, we only need .pyc (or .pyo)
      f = open(filename, 'r')
      py_compile.compile(filename)
***************
*** 103,107 ****
      # cleanup
      del sys.path[-1]
!     os.unlink(module + '.pyc')
  
  test_module_with_large_stack('longlist')
--- 103,110 ----
      # cleanup
      del sys.path[-1]
!     for ext in '.pyc', '.pyo':
!         fname = module + ext
!         if os.path.exists(fname):
!             os.unlink(fname)
  
  test_module_with_large_stack('longlist')