[Python-checkins] CVS: python/dist/src/Tools/compiler compile.py,1.3,1.4

Jeremy Hylton jhylton@users.sourceforge.net
2001年8月27日 13:39:23 -0700


Update of /cvsroot/python/python/dist/src/Tools/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv11661
Modified Files:
	compile.py 
Log Message:
Add -c option to continue if one file has a SyntaxError
Index: compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compile.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** compile.py	2000年10月13日 21:59:32	1.3
--- compile.py	2001年08月27日 20:39:21	1.4
***************
*** 4,11 ****
 from compiler import compile, visitor
 
 def main():
 VERBOSE = 0
 DISPLAY = 0
! opts, args = getopt.getopt(sys.argv[1:], 'vqd')
 for k, v in opts:
 if k == '-v':
--- 4,14 ----
 from compiler import compile, visitor
 
+ ##import profile
+ 
 def main():
 VERBOSE = 0
 DISPLAY = 0
! CONTINUE = 0
! opts, args = getopt.getopt(sys.argv[1:], 'vqdc')
 for k, v in opts:
 if k == '-v':
***************
*** 20,23 ****
--- 23,28 ----
 if k == '-d':
 DISPLAY = 1
+ if k == '-c':
+ CONTINUE = 1
 if not args:
 print "no files to compile"
***************
*** 26,30 ****
 if VERBOSE:
 print filename
! compile(filename, DISPLAY)
 
 if __name__ == "__main__":
--- 31,43 ----
 if VERBOSE:
 print filename
! try:
! compile(filename, DISPLAY)
! ## profile.run('compile(%s, %s)' % (`filename`, `DISPLAY`),
! ## filename + ".prof")
! except SyntaxError, err:
! print err
! print err.lineno
! if not CONTINUE:
! sys.exit(-1)
 
 if __name__ == "__main__":

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