FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't replace an empty line with "pass" when symbol == "eval", where · python/cpython@993bc3a · GitHub

Repository navigation

Commit 993bc3a

Browse files
committed
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).
1 parent 11659ad commit 993bc3a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/codeop.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def _maybe_compile(compiler, source, filename, symbol):
7272
if line and line[0] != '#':
7373
break # Leave it alone
7474
else:
75-
source = "pass" # Replace it with a 'pass' statement
75+
if symbol != "eval":
76+
source = "pass" # Replace it with a 'pass' statement
7677

7778
err = err1 = err2 = None
7879
code = code1 = code2 = None

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL