diff --git a/plone/registry/field.py b/plone/registry/field.py index 6fcbbb8..5e1e3ac 100644 --- a/plone/registry/field.py +++ b/plone/registry/field.py @@ -11,7 +11,6 @@ from zope.schema.interfaces import IContextSourceBinder from zope.schema.vocabulary import SimpleVocabulary -import sys import zope.schema import zope.schema._field diff --git a/plone/registry/recordsproxy.py b/plone/registry/recordsproxy.py index 3467558..8cca9c9 100644 --- a/plone/registry/recordsproxy.py +++ b/plone/registry/recordsproxy.py @@ -5,14 +5,11 @@ from zope.schema.interfaces import RequiredMissing import re -import sys try: from UserDict import DictMixin - from UserDict import UserDict except ImportError: - from collections import UserDict from collections.abc import MutableMapping as DictMixin _marker = object() diff --git a/plone/registry/registry.py b/plone/registry/registry.py index 313f759..d9cf553 100644 --- a/plone/registry/registry.py +++ b/plone/registry/registry.py @@ -18,7 +18,6 @@ from zope.schema import getFieldsInOrder import re -import sys import warnings @@ -109,7 +108,7 @@ def registerInterface(self, interface, omit=(), prefix=None): bound_field = persistent_field.bind(existing_record) try: bound_field.validate(value) - except: + except Exception: value = persistent_field.default self.records[record_name] = Record(persistent_field, value, _validate=False)