python (3.12.0)

(root)/
lib/
python3.12/
asyncio/
__pycache__/
timeouts.cpython-312.pyc

ˑe
ddlZddlmZddlmZmZmZddlmZddlm	Z	ddlm
Z
dZGd	d
ejZ
eGddZd
eedefdZdeedefdZy)N)
TracebackType)finalOptionalType)events)
exceptions)tasks)Timeouttimeout
timeout_atc eZdZdZdZdZdZdZy)_StatecreatedactiveexpiringexpiredfinishedN)__name__
__module____qualname__CREATEDENTEREDEXPIRINGEXPIREDEXITEDD/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/asyncio/timeouts.pyrrsGGHG
Frrc	eZdZdZdeeddfdZdeefdZdeeddfdZde	fdZ
defd	Zdd
Z
deeedeed
eedee	fdZddZy)rzAsynchronous context manager for cancelling overdue coroutines.

    Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
    whenreturnNcXtj|_d|_d|_||_y)zSchedule a timeout that will trigger at a given loop time.

        - If `when` is `None`, the timeout will never trigger.
        - If `when < loop.time()`, the timeout will trigger on the next
          iteration of the event loop.
        N)rr_state_timeout_handler_task_when)selfr!s  r__init__zTimeout.__init__!s%nn>B+/

rc|jS)zReturn the current deadline.)r'r(s rr!zTimeout.when.szzrc|jtjusJ|jtjur#t	d|jj
d||_|j|jj|d|_ytj}||jkr!|j|j|_y|j||j|_y)zReschedule the timeout.zCannot change state of z TimeoutN)r$rrrRuntimeErrorvaluer'r%cancelrget_running_looptime	call_soon_on_timeoutcall_at)r(r!loops   r
reschedulezTimeout.reschedule2s{{&..00;;fnn,)$++*;*;)<HE

  ,!!((*<$(D!**,Dtyy{"(,t7G7G(H%(,T4;K;K(L%rcZ|jtjtjfvS)z$Is timeout expired during execution?)r$rrrr+s rrzTimeout.expiredHs{{v???rcdg}|jtjur8|jt	|jdnd}|jd|dj
|}d|jjd|dS)Nzwhen= z
<Timeout []>)r$rrr'roundappendjoinr.)r(infor!info_strs    r__repr__zTimeout.__repr__Lsst;;&..(+/::+A5Q'tDKK%v'88D>DKK--.az;;rcKtj|_tj|_|j
j
|_|j
td|j|j|Sw)Nz$Timeout should be used inside a task)rrr$r
current_taskr&
cancelling_cancellingr-r6r'r+s r
__aenter__zTimeout.__aenter__Tsann'')
::002::EFF

#sBBexc_typeexc_valexc_tbcK|jtjtjfvsJ|j!|jjd|_|jtjurVtj|_|jj|jkr|tjurt|y|jtjurtj|_ywN)r$rrrr%r/rr&uncancelrGr	CancelledErrorTimeoutErrorr)r(rIrJrKs    r	__aexit__zTimeout.__aexit__]s{{v~~v???  ,!!((*$(D!;;&//) ..DKzz""$(8(88XIbIb=b#/[[FNN
* --DKsDDc|jtjusJ|jj	tj
|_d|_yrM)r$rrr&r/rr%r+s rr3zTimeout._on_timeoutus8{{fnn,,

oo $r)r"r)r"N)rrr__doc__rfloatr)r!r6boolrstrrCrHr
BaseExceptionrrQr3rrrrrs
Xe_huoMxM4M,@@<#<4
./-('	

$0%rrdelayr"crtj}t||j|zSdS)a	Timeout async context manager.

    Useful in cases when you want to apply timeout logic around block
    of code or in cases when asyncio.wait_for is not suitable. For example:

    >>> async with asyncio.timeout(10):  # 10 seconds timeout
    ...     await long_running_task()


    delay - value in seconds or None to disable timeout logic

    long_running_task() is interrupted by raising asyncio.CancelledError,
    the top-most affected timeout() context manager converts CancelledError
    into TimeoutError.
    N)rr0rr1)rXr5s  rrr}s5 ""$D%*;499;&FFFFrr!ct|S)abSchedule the timeout at absolute time.

    Like timeout() but argument gives absolute time in the same clock system
    as loop.time().

    Please note: it is not POSIX time but a time with
    undefined starting base, e.g. the time of the system power on.

    >>> async with asyncio.timeout_at(loop.time() + 10):
    ...     await long_running_task()


    when - a deadline when timeout occurs or None to disable timeout logic

    long_running_task() is interrupted by raising asyncio.CancelledError,
    the top-most affected timeout() context manager converts CancelledError
    into TimeoutError.
    )r)r!s rr
r
s&4=r)enumtypesrtypingrrrr9rr	r
__all__EnumrrrTrr
rrr<module>r`s((TYY_%_%_%DG8E?GwG(Xe_r