[Zope-Checkins] CVS: Zope/lib/python/OFS - SimpleItem.py:1.94
Toby Dickenson
tdickenson@geminidataloggers.com
Wed, 27 Mar 2002 05:14:33 -0500
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv10497/lib/python/OFS
Modified Files:
SimpleItem.py
Log Message:
merged toby-stiff-cache-branch and toby-unicode-branch
=== Zope/lib/python/OFS/SimpleItem.py 1.93 => 1.94 ===
from Traversable import Traversable
from Acquisition import aq_base
+from DocumentTemplate.ustr import ustr
import time
import marshal
@@ -165,16 +166,15 @@
raise error_type, error_value, tb
if not error_message:
- if type(error_value) is InstanceType:
- try:
- s=str(error_value)
- except:
- pass
- else:
- if tagSearch(s) is not None:
- error_message=error_value
- elif (type(error_value) is StringType
- and tagSearch(error_value) is not None):
+ try:
+ s = ustr(error_value)
+ except:
+ s = error_value
+ try:
+ match = tagSearch(s)
+ except TypeError:
+ match = None
+ if match is not None:
error_message=error_value
if client is None: client=self
@@ -197,7 +197,8 @@
v = s(**kwargs)
else:
v = HTML.__call__(s, client, REQUEST, **kwargs)
- except: v = error_value or "Sorry, an error occurred"
+ except:
+ v = error_value or "Sorry, an error occurred"
raise error_type, v, tb
finally:
if hasattr(self, '_v_eek'): del self._v_eek