-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Malthe Borch wrote:
Log message for revision 93341: Catch all exceptions; it's not required to be able to determine length.
Changed: U Sandbox/malthe/chameleon.core/src/chameleon/core/utils.py
-=- Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/utils.py =================================================================== --- Sandbox/malthe/chameleon.core/src/chameleon/core/utils.py 2008-11-25 14:20:12 UTC (rev 93340) +++ Sandbox/malthe/chameleon.core/src/chameleon/core/utils.py 2008-11-25 14:21:04 UTC (rev 93341) @@ -188,7 +188,9 @@ def insert(self, key, iterable): try: length = len(iterable)
except TypeError:
except:
# we catch all exceptions here, because it's not required
# for iteration length = None try:
@@ -201,7 +203,9 @@ raise TypeError( "Can only repeat over an iterable object (%s)." % iterable)
self[key] = (iterator, length)
if length is not None:
self[key] = (iterator, length)
return iterator
def __getitem__(self, key):
Hmm, some exceptions should never be caught (KeyboardInterrupt, SystemExit, ConflictError).
Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com
Tres Seaver wrote:
Hmm, some exceptions should never be caught (KeyboardInterrupt, SystemExit, ConflictError).
indeed, changing to:
except Exception:
...will do the right thing for Python >= 2.5
cheers,
Chris