a am@shddlZddlZddlZddlZddlZddlZddlZGdddeZeZ eZ eZ eZ eZ eeddddZeeddddZed d d Zejrdd lmZejd edZGdddeZejddddZd*eejeedddZGdddeZ ddZ!ddddZ"Gdd d e#Z$Gd!d"d"ej%Z&d#d$Z'd%d&Z(e'ej)e*d'e Z+Gd(d)d)ej,Z,dS)+Nc@s eZdZdS)CryptographyDeprecationWarningN__name__ __module__ __qualname__rr8/usr/lib64/python3.9/site-packages/cryptography/utils.pyrsr)namevaluereturncCst|tstd|dS)Nz{} must be bytes) isinstancebytes TypeErrorformatr r rrr _check_bytess rcCs2z t|Wn ty,td|Yn0dS)Nz{} must be bytes-like) memoryviewrrrrrr_check_byteslike$s  rr cstfddS)Ncs t|SN)getattrselfrrr,z$read_only_property..)propertyrrrrread_only_property+sr)Protocol_T_class)boundc@s$eZdZddeeedddZdS)_RegisterDecoratorTypeFcheck_annotationsklassr"r cCsdSrr)rr$r"rrr__call__5sz_RegisterDecoratorType.__call__N)rrrrboolr%rrrrr 4s r )ifacer cs dddtddfdd}|S)NFr!rr#cst||d||S)Nr!)verify_interfaceregister)r$r"r'rrregister_decorator<s z.register_interface..register_decorator)r&)r'r+rr*rregister_interface;s r,)integerlengthr cCs ||p|ddpddS)Nbig)to_bytes bit_length)r-r.rrr int_to_bytesFsr5c@s eZdZdS)InterfaceNotImplementedNrrrrrr6Lsr6cCstdd|jDS)NcSsg|]}|jtjjdqS)) annotation)replaceinspectZ Parameterempty).0Zparamrrr Rsz$strip_annotation..)r9Z Signature parametersvalues) signaturerrrstrip_annotationPs r@Fr!cCs|jD]}t||s$td||tt||tjr8qt t||}t t||}|rf||k}nt |t |k}|std||||qdS)Nz{} is missing a {!r} methodzK{}.{}'s signature differs from the expected. Expected: {!r}. Received: {!r}) __abstractmethods__hasattrr6rr rabcabstractpropertyr9r?r@)r'r$r"methodZsigactualokrrrr(Ys$    r(c@seZdZddZdS)_DeprecatedValuecCs||_||_||_dSr)r message warning_class)rr rIrJrrr__init__psz_DeprecatedValue.__init__N)rrrrKrrrrrHosrHcs<eZdZfddZddZddZddZd d ZZS) _ModuleWithDeprecationscst|j||jd<dSN_module)superrKr__dict__)rmodule __class__rrrKwsz _ModuleWithDeprecations.__init__cCs4t|j|}t|tr0tj|j|jdd|j}|SN) stacklevel) rrNr rHwarningswarnrIrJr rattrobjrrr __getattr__{s   z#_ModuleWithDeprecations.__getattr__cCst|j||dSr)setattrrN)rrZr rrr __setattr__sz#_ModuleWithDeprecations.__setattr__cCs:t|j|}t|tr*tj|j|jddt|j|dSrT) rrNr rHrWrXrIrJdelattrrYrrr __delattr__s  z#_ModuleWithDeprecations.__delattr__cCsdgt|jSrM)dirrNrrrr__dir__sz_ModuleWithDeprecations.__dir__) rrrrKr\r^r`rb __classcell__rrrRrrLvs  rLcCs.tj|}t|ts"t|tj|<t|||Sr)sysmodulesr rLrH)r Z module_namerIrJrQrrr deprecateds    rfcs(dtfdd}t|S)Nz _cached_{}cs0t|}|ur|S|}t|||Sr)rr])instancecacheresultZ cached_namefuncsentinelrrinners   zcached_property..inner)robjectr)rkrmrrjrcached_propertys roz8int_from_bytes is deprecated, use int.from_bytes insteadc@seZdZddZddZdS)EnumcCs d|jjd|jd|jdS)N<.z: >)rSr_name__value_rrrr__repr__sz Enum.__repr__cCs|jjd|jS)Nrr)rSrrtrrrr__str__sz Enum.__str__N)rrrrvrwrrrrrpsrp)N)-rCenumr9rdtypestypingrW UserWarningrZPersistentlyDeprecated2017ZPersistentlyDeprecated2019ZDeprecatedIn34ZDeprecatedIn35ZDeprecatedIn36strr rrr TYPE_CHECKINGZtyping_extensionsrTypeVartyperr ABCMetar,intOptionalr5 Exceptionr6r@r(rnrH ModuleTyperLrfro from_bytesrZint_from_bytesrprrrrsF