o ƚRe@s ddlZddlZddlZejrddlmZGdddejZGdddeZeZ GdddeZ e Z Gd d d eZ Gd d d e Z Gd dde ZGddde ZGdddeZGdddeZGddde ZGdddeZGdddeZGdddeZdS)N)RetryCallStatec@s<eZdZdZejdddefddZdd d Zdd d Z dS) retry_basez)Abstract base class for retry strategies. retry_staterreturncCsdSNselfrrr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/tenacity/retry.py__call__szretry_base.__call__other retry_allcC t||Sr)r r r rrr __and__  zretry_base.__and__ retry_anycCrr)rrrrr __or__#rzretry_base.__or__N)r rrr )r rrr) __name__ __module__ __qualname____doc__abcabstractmethodboolr rrrrrr rs  rc@"eZdZdZdddefddZdS) _retry_neverz-Retry strategy that never rejects any result.rrrcCdSNFrrrrr r *z_retry_never.__call__Nrrrrrr rrrr r'rc@r) _retry_alwaysz.Retry strategy that always rejects any result.rrrcCrNTrrrrr r 4rz_retry_always.__call__Nr rrrr r"1r!r"c@s@eZdZdZdejegefddfddZdddefd d Z dS) retry_if_exceptionzARetry strategy that retries if an exception verifies a predicate. predicaterNcC ||_dSrr%r r%rrr __init__>rzretry_if_exception.__init__rrcCs|jjr ||jSdSroutcomefailedr% exceptionrrrr r Azretry_if_exception.__call__) rrrrtypingCallable BaseExceptionrr)r rrrr r$;sr$cNeZdZdZefdejejeej ejedffddffdd Z Z S)retry_if_exception_typez=Retries if an exception has been raised of one or more types.exception_types.rNc|_tfdddS)Ncs t|Sr isinstanceer4rr Ss z2retry_if_exception_type.__init__..r4superr)r r4 __class__r:r r)Kz retry_if_exception_type.__init__ rrrr Exceptionr/UnionTyper1Tupler) __classcell__rrr?r r3Hr3cr2)retry_if_not_exception_typezARetries except an exception has been raised of one or more types.r4.rNcr5)Nc t| Srr6r8r:rr r;a z6retry_if_not_exception_type.__init__..r<r>r?r:r r)YrAz$retry_if_not_exception_type.__init__rBrrr?r rIVrHrIcs`eZdZdZefdejejeej ejedffddffdd Z dd de fd d Z Z S) retry_unless_exception_typez:Retries until an exception is raised of one or more types.r4.rNcr5)NcrJrr6r8r:rr r;orKz6retry_unless_exception_type.__init__..r<r>r?r:r r)grAz$retry_unless_exception_type.__init__rrcC|jjsdS||jSr#r*rrrr r qsz$retry_unless_exception_type.__call__)rrrrrCr/rDrEr1rFr)rr rGrrr?r rLds rLc@BeZdZdZdejejgefddfddZdddefd d Z dS) retry_if_resultz+Retries if the result verifies a predicate.r%rNcCr&rr'r(rrr r){rzretry_if_result.__init__rrcCs|jjs ||jSdSrr+r,r%resultrrrr r ~r.zretry_if_result.__call__ rrrrr/r0Anyrr)r rrrr rOx rOc@rN) retry_if_not_resultz*Retries if the result refutes a predicate.r%rNcCr&rr'r(rrr r)rzretry_if_not_result.__init__rrcCs|jjs ||j SdSrrPrrrr r szretry_if_not_result.__call__rRrrrr rUrTrUcs@eZdZdZ  ddejedejeddffdd ZZS) retry_if_exception_messagez2Retries if an exception message equals or matches.Nmessagematchrcsr |r t|jjdrdtdtffdd }|}n|r2t|dtdtffdd }|}n t|jjdt|dS) Nz.() takes either 'message' or 'match', not bothr-rcs t|kSr)strr-)rWrr message_fncs z8retry_if_exception_message.__init__..message_fnccstt|Sr)rrXrYrZ)progrr match_fncsz6retry_if_exception_message.__init__..match_fncz3() missing 1 required argument 'message' or 'match') TypeErrorr@rr1rrecompiler=r))r rWrXr[r%r]r?)rWr\r r)s z#retry_if_exception_message.__init__NN) rrrrr/OptionalrYr)rGrrr?r rVsrVcsReZdZdZ  d dejedejeddffdd Zdd defd d Z Z S) retry_if_not_exception_messagez5Retries until an exception message equals or matches.NrWrXrcs&t|||jfdd|_dS)Ncs|i| Srr)args_kwargs_ if_predicaterr r;sz9retry_if_not_exception_message.__init__..)r=r)r%)r rWrXr?rfr r)sz'retry_if_not_exception_message.__init__rrcCrMr#r*rrrr r sz'retry_if_not_exception_message.__call__ra) rrrrr/rbrYr)rr rGrrr?r rcs rcc@4eZdZdZdeddfddZdddefd d ZdS) rz1Retries if any of the retries condition is valid.retriesrNcGr&rrir rirrr r)rzretry_any.__init__rrctfdd|jDS)Nc3|]}|VqdSrr.0rrrr z%retry_any.__call__..)anyrirrrqr r zretry_any.__call__rrrrrr)rr rrrr rrc@rh) r z/Retries if all the retries condition are valid.rirNcGr&rrjrkrrr r)rzretry_all.__init__rrcrl)Nc3rmrrrnrqrr rrrsz%retry_all.__call__..)allrirrrqr r ruzretry_all.__call__rvrrrr r rwr )rr_r/ TYPE_CHECKINGpip._vendor.tenacityrABCrr retry_neverr" retry_alwaysr$r3rIrLrOrUrVrcrr rrrr s(