summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jason+github@nextthought.com>2018-09-22 08:26:44 -0500
committerGitHub <noreply@github.com>2018-09-22 08:26:44 -0500
commit7174ee9d98d09d817b12ad3be585ba08e2b33614 (patch)
tree4fdefd7806ad95b106865a5c3277b4bbdfe791ca
parent0ea91989e33592155891da0eeace996b0e4d3506 (diff)
parentf9dc66fe2089b0a7b15fca841eb8e5a9c8eda6a8 (diff)
downloadzope-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.rst9
-rw-r--r--src/zope/configuration/config.py6
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"
)
-