[Python-checkins] CVS: python/dist/src/Lib/test test_pkgimport.py,1.1,1.2

Tim Peters tim_one@users.sourceforge.net
2001年8月02日 10:23:13 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7568/python/dist/src/Lib/test
Modified Files:
	test_pkgimport.py 
Log Message:
This test failed under python -O.
rewrite_file(): Delete both .pyc and .pyo leftovers, and explicitly close
the new source file after writing to it.
Index: test_pkgimport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pkgimport.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_pkgimport.py	2001年08月02日 14:14:20	1.1
--- test_pkgimport.py	2001年08月02日 17:23:11	1.2
***************
*** 37,43 ****
 
 def rewrite_file(self, contents):
! compiled_path = self.module_path + 'c'
! if os.path.exists(compiled_path): os.remove(compiled_path)
! open(self.module_path, 'w').write(contents)
 
 def test_package_import__semantics(self):
--- 37,47 ----
 
 def rewrite_file(self, contents):
! for extension in "co":
! compiled_path = self.module_path + extension
! if os.path.exists(compiled_path):
! os.remove(compiled_path)
! f = open(self.module_path, 'w')
! f.write(contents)
! f.close()
 
 def test_package_import__semantics(self):

AltStyle によって変換されたページ (->オリジナル) /