Stefan H. Holek wrote:
Log message for revision 72754:
Raise SyntaxError when encountering invalid PythonScript headers.
Changed:
U Zope/branches/2.9/lib/python/Products/PythonScripts/PythonScript.py
U
Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py
A
Zope/branches/2.9/lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps
-=-
Modified: Zope/branches/2.9/lib/python/Products/PythonScripts/PythonScript.py
===================================================================
--- Zope/branches/2.9/lib/python/Products/PythonScripts/PythonScript.py
2007-02-22 05:58:28 UTC (rev 72753)
+++ Zope/branches/2.9/lib/python/Products/PythonScripts/PythonScript.py
2007-02-22 10:17:20 UTC (rev 72754)
@@ -416,7 +416,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
Stefan,
thanks for the fix. Just note that according to PEP8 and PEP3100, this
style of raising exceptions will go away (see
http://mail.python.org/pipermail/python-dev/2005-August/055190.html).
The whole Zope code base has already been converted to the new style
long ago, new code should also adhere to it.
--
http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )