mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #10859: Make contextlib.GeneratorContextManager
officially
private by renaming it to `_GeneratorContextManager`.
This commit is contained in:
parent
d97b7b5158
commit
67b212e608
3 changed files with 11 additions and 8 deletions
|
@ -17,7 +17,7 @@ class ContextDecorator(object):
|
|||
return inner
|
||||
|
||||
|
||||
class GeneratorContextManager(ContextDecorator):
|
||||
class _GeneratorContextManager(ContextDecorator):
|
||||
"""Helper for @contextmanager decorator."""
|
||||
|
||||
def __init__(self, gen):
|
||||
|
@ -92,7 +92,7 @@ def contextmanager(func):
|
|||
"""
|
||||
@wraps(func)
|
||||
def helper(*args, **kwds):
|
||||
return GeneratorContextManager(func(*args, **kwds))
|
||||
return _GeneratorContextManager(func(*args, **kwds))
|
||||
return helper
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue