Skip to content

Commit baf1297

Browse files
committed
Fixed the ContextManager
1 parent 0094c7b commit baf1297

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
HISTORY
22
--------
33

4+
## Unreleased
5+
6+
The "fix" in version 5.1 broke `decorator.contextmanager` even more.
7+
This is now solved, thanks to Wim Glenn.
8+
49
## 5.1.0 (2021-09-11)
510

611
Added a function `decoratorx` using the `FunctionMaker` and thus

src/decorator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def __init__(self, g, *a, **k):
313313

314314
def __call__(self, func):
315315
def caller(f, *a, **k):
316-
with self._recreate_cm():
316+
with self.__class__(self.func, *self.args, **self.kwds):
317317
return f(*a, **k)
318318
return decorate(func, caller)
319319

0 commit comments

Comments
 (0)