Commit 1bc58665 authored by Andreas Jung's avatar Andreas Jung

fix for tests

parent e0e13c12
...@@ -21,6 +21,7 @@ $Id$ ...@@ -21,6 +21,7 @@ $Id$
import logging import logging
from zope.component import getUtility from zope.component import getUtility
from zope.component.interfaces import ComponentLookupError
from zope.interface import implements from zope.interface import implements
from zope.tales.tales import Context, Iterator from zope.tales.tales import Context, Iterator
from zope.tales.expressions import PathExpr, StringExpr, NotExpr from zope.tales.expressions import PathExpr, StringExpr, NotExpr
...@@ -199,7 +200,15 @@ class ZopeContext(Context): ...@@ -199,7 +200,15 @@ class ZopeContext(Context):
elif isinstance(text, str): elif isinstance(text, str):
# bahh...non-unicode string..we need to convert it to unicode # bahh...non-unicode string..we need to convert it to unicode
resolver = getUtility(IUnicodeEncodingConflictResolver)
# catch ComponentLookupError in order to make tests shut-up.
# This should not be a problem since it won't change the old
# default behavior
try:
resolver = getUtility(IUnicodeEncodingConflictResolver)
except ComponentLookupError:
return unicode(text)
try: try:
return resolver.resolve(self.contexts['context'], text, expr) return resolver.resolve(self.contexts['context'], text, expr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment