| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Turn deprecation warnings added in 3.8 into TypeError.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deprecated passing the following arguments as keyword arguments:
- "func" in functools.partialmethod(), weakref.finalize(),
profile.Profile.runcall(), cProfile.Profile.runcall(),
bdb.Bdb.runcall(), trace.Trace.runfunc() and
curses.wrapper().
- "function" in unittest.addModuleCleanup() and
unittest.TestCase.addCleanup().
- "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor
and concurrent.futures.ProcessPoolExecutor.
- "callback" in contextlib.ExitStack.callback(),
contextlib.AsyncExitStack.callback() and
contextlib.AsyncExitStack.push_async_callback().
- "c" and "typeid" in the create() method of multiprocessing.managers.Server
and multiprocessing.managers.SharedMemoryServer.
- "obj" in weakref.finalize().
Also allowed to pass arbitrary keyword arguments (even "self" and "func")
if the above arguments are passed as positional argument.
|
|
|
|
| |
(GH-7467)
|
|
|
|
|
|
| |
ExitStack (GH-6456)
`MethodType` has the exact semantics that `ExitStack` needs,
so we can avoid creating a Python level closure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The arguments to a generator function which is declared as a
contextmanager are stored inside the context manager, and
thus are kept alive, even when it is used as a regular context
manager, and not as a function decorator (where it needs
the original arguments to recreate the generator on each
call).
This is a possible unnecessary memory leak, so this changes
contextmanager.__enter__ to release the saved arguments,
as that method being called means that particular CM instance
isn't going to need to recreate the underlying generator.
Patch by Martin Teichmann.
|
| |
|
| |
|
|
|
|
|
| |
Adds a simpler and faster alternative to ExitStack for handling
single optional context managers without having to change the
lexical structure of your code.
|
|
|
|
|
| |
contextlib.AbstractContextManager now supports anti-registration
by setting __enter__ = None or __exit__ = None, following the pattern
introduced in bpo-25958.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-949)
contextlib._GeneratorContextManager.__exit__ includes a special case to deal with
PEP 479 RuntimeErrors created when `StopIteration` is thrown into the context
manager body.
Previously this check was too permissive, and undid one level of chaining on *all*
RuntimeError instances, not just those that wrapped a StopIteration instance.
|
|
|
| |
Moved explicit raise from inside try to try...else.
|
|
|
|
|
|
| |
It took me quite a bit to figure out what this was referring to,
since the given issue number is wrong, and the original commit
message I found through git blame lists a different, also wrong
issue number... see https://bugs.python.org/issue27122#msg279449
|
|\
| |
| |
| |
| |
| |
| | |
managed by a contextlib.ExitStack() and one of the exit stack
generators catches and raises it in a chain, do not re-raise the
original exception when exiting, let the new chained one through.
This avoids the PEP 479 bug described in issue25782.
|
| |
| |
| |
| |
| |
| |
| | |
managed by a contextlib.ExitStack() and one of the exit stack
generators catches and raises it in a chain, do not re-raise the
original exception when exiting, let the new chained one through.
This avoids the PEP 479 bug described in issue25782.
|
| | |
|
|/
|
|
| |
typing.ContextManager.
|
|\
| |
| |
| | |
keyword arguments called "func" and "self". Patch by Martin Panter.
|
| |
| |
| |
| | |
keyword arguments called "func" and "self". Patch by Martin Panter.
|
| |
| |
| |
| | |
Closes issue #22906.
|
|/ |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
- Alex J Burke noticed a debugging raise in the commit that
fixed the original bug reported in issue 20317
- this showed that multiple iterations through the affected
loop wasn't actually being tested
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
- added test cases to ensure docstrings are reasonable
- also updates various comments in contextlib for accuracy
- identifed #19404 as an issue making it difficult to provide
good help output on generator based context manager instances
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- explain single use, reusable and reentrant in docs
- converted suppress to a reentrant class based impl
- converted redirect_stdout to a reusable impl
- moved both suppress and redirect_stdout behind a functional
facade
- added reentrancy tests for the updated suppress
- added reusability tests for the updated redirect_stdio
- slightly cleaned up an exception from contextmanager
|
| |
| |
| |
| | |
Patch by Zero Piraeus.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Report and patch by Hrvoje Nikšić
|
|\ \
| |/ |
|
|/ |
|
|\
| |
| |
| | |
Patch by Serhiy Storchaka.
|
| | |
|
| |
| |
| |
| | |
(Patch by Alon Horev)
|
| |
| |
| |
| | |
contextlib.nested API
|
|/
|
|
| |
A patch from Vincent Legoll.
|
| |
|
|
|
|
| |
described in the docs. Initial patch by Ysj Ray.
|
|
|
|
| |
private by renaming it to `_GeneratorContextManager`.
|
|
|
|
| |
of APIs that act as decorators as well as context managers. contextlib.contextmanager changed to use ContextDecorator.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73518 | nick.coghlan | 2009-06-23 20:19:30 +1000 (Tue, 23 Jun 2009) | 1 line
Issue 6288: Update contextlib.nested() docstring to reflect new documentation
........
r73519 | nick.coghlan | 2009-06-23 20:51:02 +1000 (Tue, 23 Jun 2009) | 1 line
Remove markup from docstring
........
|
| |
|