[Python-checkins] python/dist/src/Lib/test test_compile.py,1.10,1.11

theller@users.sourceforge.net theller@users.sourceforge.net
Tue, 09 Jul 2002 02:23:29 -0700


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

Modified Files:
	test_compile.py 
Log Message:
Fix SF Bug 564931: compile() traceback must include filename.


Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** test_compile.py	13 Nov 2001 22:03:20 -0000	1.10
--- test_compile.py	9 Jul 2002 09:23:26 -0000	1.11
***************
*** 23,26 ****
--- 23,35 ----
      pass
  
+ if verbose:
+     print "compiling string with syntax error"
+ 
+ try:
+     compile("1+*3", "filename", "exec")
+ except SyntaxError, detail:
+     if not detail.filename == "filename":
+         raise TestFailed, "expected 'filename', got %r" % detail.filename
+ 
  try:
      exec 'def f(a = 0, a = 1): pass'