summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2021-11-01 16:34:21 +0100
committerMichele Simionato <michele.simionato@gmail.com>2021-11-01 16:34:21 +0100
commitbaf129705a56ead40a71b1813003439e06fd1538 (patch)
tree235d99c04758ece4d53b944e5894fe5126ce05ae
parent0094c7b282a45aaa234f14b90984ccdc350dc6c5 (diff)
downloadpython-decorator-git-baf129705a56ead40a71b1813003439e06fd1538.tar.gz
Fixed the ContextManager
-rw-r--r--CHANGES.md5
-rw-r--r--src/decorator.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 6ca893b..a867bed 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,11 @@
HISTORY
--------
+## Unreleased
+
+The "fix" in version 5.1 broke `decorator.contextmanager` even more.
+This is now solved, thanks to Wim Glenn.
+
## 5.1.0 (2021-09-11)
Added a function `decoratorx` using the `FunctionMaker` and thus
diff --git a/src/decorator.py b/src/decorator.py
index 7980acf..ac78479 100644
--- a/src/decorator.py
+++ b/src/decorator.py
@@ -313,7 +313,7 @@ class ContextManager(_GeneratorContextManager):
def __call__(self, func):
def caller(f, *a, **k):
- with self._recreate_cm():
+ with self.__class__(self.func, *self.args, **self.kwds):
return f(*a, **k)
return decorate(func, caller)