[Python-checkins] python/dist/src/Tools/compiler dumppyc.py, 1.2, 1.2.28.1

jhylton at users.sourceforge.net jhylton at users.sourceforge.net
Wed Feb 11 14:10:42 EST 2004


Update of /cvsroot/python/python/dist/src/Tools/compiler
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30945/compiler

Modified Files:
      Tag: release23-maint
	dumppyc.py 
Log Message:
If there is no .pyc file, just compile the code directly.


Index: dumppyc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/dumppyc.py,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -C2 -d -r1.2 -r1.2.28.1
*** dumppyc.py	17 Sep 2001 18:08:20 -0000	1.2
--- dumppyc.py	11 Feb 2004 19:10:40 -0000	1.2.28.1
***************
*** 14,22 ****
  
  def loadCode(path):
!     f = open(path)
!     f.read(8)
!     co = marshal.load(f)
!     f.close()
!     return co
  
  def walk(co, match=None):
--- 14,25 ----
  
  def loadCode(path):
!     if path[-1] == "c":
!         f = open(path)
!         f.read(8)
!         co = marshal.load(f)
!         f.close()
!         return co
!     else:
!         return compile(open(path).read(), path, "exec")
  
  def walk(co, match=None):




More information about the Python-checkins mailing list