Skip to content

Commit

Permalink
Fixed bug ignoring NotImplementedError
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWhittingham committed Jul 4, 2019
1 parent 907fad8 commit d0e3fce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions agsconfig/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.1.8"
__author__ = "David Whittingham; Chris Blanchfield"
__version__ = "0.1.9"
__author__ = "David Whittingham; Chris Blanchfield"
__copyright__ = "Copyright (C) 2019 David Whittingham"
32 changes: 16 additions & 16 deletions agsconfig/services/service_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,23 @@ def _set_props_from_dict(self, prop_dict, ignore_not_implemented=False):
Can be overridden by sub-classes.
"""
for key, value in prop_dict.items():
if hasattr(self, key):
try:
setattr(self, key, value)
except AttributeError:
getattr(self, key)._set_props_from_dict(value, ignore_not_implemented)
except NotImplementedError:
t, v, tb = _sys.exc_info()
if ignore_not_implemented:
self._logger.warning(
"Tried to set the '%s' property to '%s', but this is not supported on the supplied configuration format.", key, value
)
else:
raise_(t, v, tb)
except Exception:
t, v, tb = _sys.exc_info()
self._logger.error("An unknown exception was thrown setting the '%s' property.", key)
try:
setattr(self, key, value)
except AttributeError:
# property has no setter, probably an extension
getattr(self, key)._set_props_from_dict(value, ignore_not_implemented)
except NotImplementedError:
t, v, tb = _sys.exc_info()
if ignore_not_implemented:
self._logger.warning(
"Tried to set the '%s' property to '%s', but this is not supported on the supplied configuration format.", key, value
)
else:
raise_(t, v, tb)
except Exception:
t, v, tb = _sys.exc_info()
self._logger.error("An unknown exception was thrown setting the '%s' property.", key)
raise_(t, v, tb)

access_information = _EditorProperty(
{
Expand Down

0 comments on commit d0e3fce

Please sign in to comment.