summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2002-07-09 09:23:27 (GMT)
committerThomas Heller <theller@ctypes.org>2002-07-09 09:23:27 (GMT)
commit6b17abf6c0ddaed423a76e665124a80afbc39fe7 (patch)
tree2ac5bf135de125db8dc0d2cf942a9cd554fcde3d /Lib/test
parent4254cbd29c77f3d26d701198735957375a995dcc (diff)
downloadcpython-6b17abf6c0ddaed423a76e665124a80afbc39fe7.zip
cpython-6b17abf6c0ddaed423a76e665124a80afbc39fe7.tar.gz
cpython-6b17abf6c0ddaed423a76e665124a80afbc39fe7.tar.bz2
Fix SF Bug 564931: compile() traceback must include filename.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_compile.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 3801cac..c063855 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -22,6 +22,15 @@ try:
except SyntaxError:
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'
raise TestFailed, "duplicate keyword arguments"