File: //lib64/python3.6/__pycache__/contextlib.cpython-36.opt-1.pyc
3
\j3 @ s d Z ddlZddlZddlZddlmZ ddlmZ ddddd d
ddgZG d
d dej Z
G dd deZG dd dee
Z
dd ZG dd de
ZG dd de
ZG dd
d
eZG dd deZG dd de
ZG dd d e
ZdS )z4Utilities for with-statement contexts. See PEP 343. N)deque)wrapscontextmanagerclosingAbstractContextManagerContextDecorator ExitStackredirect_stdoutredirect_stderrsuppressc @ s2 e Zd ZdZdd Zejdd Zedd Z dS ) r z,An abstract base class for context managers.c C s | S )z0Return `self` upon entering the runtime context. )selfr r "/usr/lib64/python3.6/contextlib.py __enter__ s z AbstractContextManager.__enter__c C s dS )z9Raise any exception triggered within the runtime context.Nr )r
exc_type exc_value tracebackr r r __exit__ s zAbstractContextManager.__exit__c C s | t krtj|ddS tS )Nr r )r _collections_abc_check_methodsNotImplemented)clsCr r r __subclasshook__ s z'AbstractContextManager.__subclasshook__N)
__name__
__module____qualname____doc__r abcabstractmethodr classmethodr r r r r r
s c @ s e Zd ZdZdd Zdd ZdS )r zJA base class or mixin that enables context managers to work as decorators.c C s | S )a6 Return a recreated instance of self.
Allows an otherwise one-shot context manager like
_GeneratorContextManager to support use as
a decorator via implicit recreation.
This is a private interface just for _GeneratorContextManager.
See issue #11647 for details.
r )r
r r r _recreate_cm$ s
zContextDecorator._recreate_cmc s t fdd}|S )Nc
s j | |S Q R X d S )N)r! )argskwds)funcr
r r inner1 s
z(ContextDecorator.__call__.<locals>.inner)r )r
r$ r% r )r$ r
r __call__0 s zContextDecorator.__call__N)r r r r r! r&