We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5f4f66 commit 5fdcbbdCopy full SHA for 5fdcbbd
source_py3/python_toolbox/context_management/functions.py
@@ -160,6 +160,11 @@ def _wrap_context_manager_or_class(cls, thing):
160
thing.__name__,
161
''.join(random.choice(string.ascii_letters) for _ in range(30))
162
)
163
+ # We're exposing the wrapped context manager under two names,
164
+ # `__wrapped__` and a randomly created one. The first one is used
165
+ # for convenience but we still define the second one to ensure our
166
+ # mechanism can rely on it even when the `__wrapped__` attribute is
167
+ # being overridden.
168
return type(
169
170
(thing,),
0 commit comments