summaryrefslogtreecommitdiffstats
path: root/Lib/codeop.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-05-16 01:24:30 (GMT)
committerGuido van Rossum <guido@python.org>2003-05-16 01:24:30 (GMT)
commit993bc3a708a90be090626e1a4e188b1bf613b69b (patch)
treeb2bbcb2bb38d35b60835b1b251ea41721259cecd /Lib/codeop.py
parent11659ade1e63095ac6217b4e190c14b494ddcf82 (diff)
downloadcpython-993bc3a708a90be090626e1a4e188b1bf613b69b.zip
cpython-993bc3a708a90be090626e1a4e188b1bf613b69b.tar.gz
cpython-993bc3a708a90be090626e1a4e188b1bf613b69b.tar.bz2
Don't replace an empty line with "pass" when symbol == "eval", where
"pass" isn't valid syntax. Reported by Samuele Pedroni on python-dev (May 12, 2003).
Diffstat (limited to 'Lib/codeop.py')
-rw-r--r--Lib/codeop.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/codeop.py b/Lib/codeop.py
index cc9d5b2..e7c0f1f 100644
--- a/Lib/codeop.py
+++ b/Lib/codeop.py
@@ -72,7 +72,8 @@ def _maybe_compile(compiler, source, filename, symbol):
if line and line[0] != '#':
break # Leave it alone
else:
- source = "pass" # Replace it with a 'pass' statement
+ if symbol != "eval":
+ source = "pass" # Replace it with a 'pass' statement
err = err1 = err2 = None
code = code1 = code2 = None