diff options
author | Jason Madden <jason+github@nextthought.com> | 2018-09-22 08:26:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-22 08:26:44 -0500 |
commit | 7174ee9d98d09d817b12ad3be585ba08e2b33614 (patch) | |
tree | 4fdefd7806ad95b106865a5c3277b4bbdfe791ca | |
parent | 0ea91989e33592155891da0eeace996b0e4d3506 (diff) | |
parent | f9dc66fe2089b0a7b15fca841eb8e5a9c8eda6a8 (diff) | |
download | zope-configuration-7174ee9d98d09d817b12ad3be585ba08e2b33614.tar.gz |
Merge pull request #22 from zopefoundation/feature-GCD-not-shadow-builtin
Make ``GroupingContextDecorator`` stop shadowing builtins in ``__getattr__``
-rw-r--r-- | CHANGES.rst | 9 | ||||
-rw-r--r-- | src/zope/configuration/config.py | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 3002236..e242fea 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,8 +10,13 @@ Changes - Drop support for ``python setup.py test``. -- Fix resolving names from a Python 2 package whose `__init__.py` has - unicode elements in `__all__`. +- Fix resolving names from a Python 2 package whose ``__init__.py`` has + unicode elements in ``__all__``. + +- Make ``GroupingContextDecorator`` stop shadowing builtins in its + ``__getattr__``. These were not intended as arguments to be used by + subclasses, and the signature caused confusion. + 4.1.0 (2017-04-26) ------------------ diff --git a/src/zope/configuration/config.py b/src/zope/configuration/config.py index 41cd5ba..8b41420 100644 --- a/src/zope/configuration/config.py +++ b/src/zope/configuration/config.py @@ -386,7 +386,7 @@ class ConfigurationMachine(ConfigurationAdapterRegistry, ConfigurationContext): reraise(ConfigurationExecutionError(t, v, info), None, tb) finally: - del t, v, tb + del t, v, tb finally: if clear: @@ -597,8 +597,7 @@ class GroupingContextDecorator(ConfigurationContext): for name, v in kw.items(): setattr(self, name, v) - def __getattr__(self, name, - getattr=getattr, setattr=setattr): + def __getattr__(self, name): v = getattr(self.context, name) # cache result in self setattr(self, name, v) @@ -1039,4 +1038,3 @@ def _bootstrap(context): handler="zope.configuration.config.provides", schema="zope.configuration.config.IProvidesDirectiveInfo" ) - |