[Zope-Checkins] CVS: Zope/lib/python/DocumentTemplate/sequence - SortEx.py:1.7
Andreas Jung
andreas@digicool.com
Sat, 19 Oct 2002 02:46:35 -0400
Update of /cvs-repository/Zope/lib/python/DocumentTemplate/sequence
In directory cvs.zope.org:/tmp/cvs-serv18768
Modified Files:
SortEx.py
Log Message:
- replaced explicit declaration of TupleType
- fixed broken except statement
=== Zope/lib/python/DocumentTemplate/sequence/SortEx.py 1.6 => 1.7 ===
--- Zope/lib/python/DocumentTemplate/sequence/SortEx.py:1.6 Tue Sep 24 18:06:27 2002
+++ Zope/lib/python/DocumentTemplate/sequence/SortEx.py Sat Oct 19 02:46:35 2002
@@ -17,9 +17,7 @@
$Id$
"""
-
-TupleType=type(())
-
+from types import TupleType
def sort(sequence, sort=(), _=None, mapping=0):
"""
@@ -108,7 +106,7 @@
try:
if mapping: k = v[sort]
else: k = getattr(v, sort)
- except AttributeError, KeyError: k = None
+ except (AttributeError, KeyError): k = None
if not basic_type(type(k)):
try: k = k()
except: pass