Skip to content

Commit

Permalink
Require zope.catalog 4.2.1 and drop our workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed May 9, 2017
1 parent 5a42a8a commit 609e8e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -124,7 +124,7 @@ def read(*rnames):
'persistent',
'pytz',
'setuptools',
'zope.catalog >= 4.2.0',
'zope.catalog >= 4.2.1',
'zope.component >= 4.3.0',
'zope.container >= 4.1.0',
'zope.i18nmessageid >= 4.1.0',
Expand Down
24 changes: 2 additions & 22 deletions src/zc/catalog/catalogindex.py
Expand Up @@ -27,33 +27,13 @@
class ValueIndex(zope.catalog.attribute.AttributeIndex,
zc.catalog.index.ValueIndex,
zope.container.contained.Contained):

def __init__(self, field_name=None, interface=None, field_callable=False,
*args, **kwargs):
if field_name and not isinstance(field_name, str):
# Workaround for https://github.com/zopefoundation/zope.catalog/issues/7
if bytes is str: # pragma: no cover
field_name = str(field_name)
else:
field_name = field_name.decode('utf-8')
super(ValueIndex, self).__init__(field_name, interface, field_callable, *args, **kwargs)

pass

@zope.interface.implementer(zc.catalog.interfaces.ICatalogSetIndex)
class SetIndex(zope.catalog.attribute.AttributeIndex,
zc.catalog.index.SetIndex,
zope.container.contained.Contained):

def __init__(self, field_name=None, interface=None, field_callable=False,
*args, **kwargs):
if field_name and not isinstance(field_name, str):
# Workaround for https://github.com/zopefoundation/zope.catalog/issues/7
if bytes is str: # pragma: no cover
field_name = str(field_name)
else:
field_name = field_name.decode('utf-8')
super(SetIndex, self).__init__(field_name, interface, field_callable, *args, **kwargs)

pass

class NormalizationWrapper(
zope.catalog.attribute.AttributeIndex,
Expand Down

0 comments on commit 609e8e1

Please sign in to comment.