[Checkins] SVN: Zope/trunk/lib/python/Products/PythonScripts/
Merged r72753:72754 from 2.9 branch.
Stefan H. Holek
stefan at epy.co.at
Thu Feb 22 05:22:20 EST 2007
Log message for revision 72756:
Merged r72753:72754 from 2.9 branch.
Raise SyntaxError when encountering invalid PythonScript headers.
Changed:
U Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py
U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py
A Zope/trunk/lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps
-=-
Modified: Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py
===================================================================
--- Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py 2007-02-22 10:19:26 UTC (rev 72755)
+++ Zope/trunk/lib/python/Products/PythonScripts/PythonScript.py 2007-02-22 10:22:19 UTC (rev 72756)
@@ -417,7 +417,7 @@
k = k.strip().lower()
v = v.strip()
if not mdata.has_key(k):
- SyntaxError, 'Unrecognized header line "%s"' % line
+ raise SyntaxError, 'Unrecognized header line "%s"' % line
if v == mdata[k]:
# Unchanged value
continue
Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py
===================================================================
--- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2007-02-22 10:19:26 UTC (rev 72755)
+++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2007-02-22 10:22:19 UTC (rev 72756)
@@ -197,6 +197,9 @@
bound = f.__render_with_namespace__({'yes': 1, 'no': self.fail})
self.assertEqual(bound, 1)
+ def testNSBindInvalidHeader(self):
+ self.assertRaises(SyntaxError, self._filePS, 'ns_bind_invalid')
+
def testBooleanMap(self):
res = self._filePS('boolean_map')()
self.failUnless(res)
Copied: Zope/trunk/lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps (from rev 72754, Zope/branches/2.9/lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps)
More information about the Checkins
mailing list