Skip to content

Commit

Permalink
- Collector #2295: Comments in PythonScripts could lead to syntax
Browse files Browse the repository at this point in the history
        errors
  • Loading branch information
zopyx committed Jun 23, 2007
1 parent d845bf4 commit 72cf607
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/RestrictedPython/tests/testRestrictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,17 @@ def checkLineEndingsRestrictedCompileMode(self):
# parse() is called, then you'll get a syntax error.
gen.parse()

def checkCollector2295(self):
from RestrictedPython.RCompile import RestrictedCompileMode
gen = RestrictedCompileMode(
'if False:\n pass\n# Me Grok, Say Hi',
'<testing>'
)
gen.mode='exec'
# if the source has any line ending other than \n by the time
# parse() is called, then you'll get a syntax error.
gen.parse()


create_rmodule()

Expand Down

0 comments on commit 72cf607

Please sign in to comment.