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).
This commit is contained in:
Guido van Rossum 2003-05-16 01:24:30 +00:00
parent 11659ade1e
commit 993bc3a708
1 changed files with 2 additions and 1 deletions

View File

@ -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