[Zope-Checkins] SVN: Zope/trunk/ Fix bad except clause in the ``sequence_sort`` method of the ``<dtml-in>`` tag.
Tres Seaver
tseaver at palladion.com
Sat May 8 01:48:11 EDT 2010
Log message for revision 112187:
Fix bad except clause in the ``sequence_sort`` method of the ``<dtml-in>`` tag.
LP #267820
Changed:
U Zope/trunk/doc/CHANGES.rst
U Zope/trunk/src/DocumentTemplate/DT_In.py
-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst 2010-05-08 05:47:04 UTC (rev 112186)
+++ Zope/trunk/doc/CHANGES.rst 2010-05-08 05:48:10 UTC (rev 112187)
@@ -152,6 +152,9 @@
Bugs Fixed
++++++++++
+- LP #267820: Fix bad except clause in the ``sequence_sort`` method of
+ the ``<dtml-in>`` tag.
+
- LP #351006: Don't nest block tags inside HTML ``<p>`` tags in
``zExceptions.ExceptionFormatter``.
Modified: Zope/trunk/src/DocumentTemplate/DT_In.py
===================================================================
--- Zope/trunk/src/DocumentTemplate/DT_In.py 2010-05-08 05:47:04 UTC (rev 112186)
+++ Zope/trunk/src/DocumentTemplate/DT_In.py 2010-05-08 05:48:10 UTC (rev 112187)
@@ -761,19 +761,15 @@
if multsort: # More than one sort key.
k = []
for sk in sortfields:
- try:
- if mapping: akey = v[sk]
- else: akey = getattr(v, sk)
- except AttributeError, KeyError: akey = None
+ if mapping: akey = v.get(sk)
+ else: akey = getattr(v, sk, None)
if not basic_type(akey):
try: akey = akey()
except: pass
k.append(akey)
else: # One sort key.
- try:
- if mapping: k = v[sort]
- else: k = getattr(v, sort)
- except AttributeError, KeyError: k = None
+ if mapping: k = v.get(sort)
+ else: k = getattr(v, sort, None)
if not basic_type(type(k)):
try: k = k()
except: pass
More information about the Zope-Checkins
mailing list