Commit 50c33616 authored by Andreas Jung's avatar Andreas Jung

- Collector #2295: Comments in PythonScripts could lead to syntax

        errors
parent 44d8608e
......@@ -4,10 +4,13 @@ Zope Changes
Change information for previous versions of Zope can be found in the
file HISTORY.txt.
Zope 2.9.8 (unreleased)
Zope 2.9.8 (24.06.2007)
Bugs fixed
- Collector #2295: Comments in PythonScripts could lead to syntax
errors
- Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
- Fixed ZClass test breakage due to non-pickleability of
......
......@@ -128,6 +128,9 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
res = self._newPS('return 1 * 5 + 4 / 2 - 6')()
self.assertEqual(res, 1)
def testCollector2295(self):
res = self._newPS('if False:\n pass\n#hi')
def testReduce(self):
res = self._newPS('return reduce(lambda x, y: x + y, [1,3,5,7])')()
self.assertEqual(res, 16)
......
......@@ -43,7 +43,7 @@ class RestrictedCompileMode(AbstractCompileMode):
def __init__(self, source, filename):
if source:
source = '\n'.join(source.splitlines())
source = '\n'.join(source.splitlines()) + '\n'
self.rm = RestrictionMutator()
AbstractCompileMode.__init__(self, source, filename)
......@@ -209,7 +209,7 @@ class RFunction(RModule):
def __init__(self, p, body, name, filename, globals):
self.params = p
if body:
body = '\n'.join(body.splitlines())
body = '\n'.join(body.splitlines()) + '\n'
self.body = body
self.name = name
self.globals = globals or []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment