a Re} @sddlmZmZmZmZmZddlZddlZddlm Z m Z e dZ Gdddej Z Gdd d ejZGd d d ejZGd d d e ejZGddde ejZddZdS))encodedecodealabelulabel IDNAErrorN)TupleOptionalu [.。.。]c@s eZdZdddZdddZdS) CodecstrictcCs.|dkrtd||sdSt|t|fS)Nr Unsupported error handling "{}")r)rformatrlenselfdataerrorsr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/idna/codec.pyr s z Codec.encodecCs.|dkrtd||sdSt|t|fS)Nr r r)rrrrrrrrrs z Codec.decodeN)r )r )__name__ __module__ __qualname__rrrrrrr s r c@seZdZddZdS)IncrementalEncoderc Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}|D]*}|t||r|d7}|t|7}qbd||} |t|7}| |fS Nr r rr.rr)rr_unicode_dots_resplitappendrrjoin rrrfinallabels trailing_dotresultsizelabelZ result_strrrr_buffer_encodes0  z!IncrementalEncoder._buffer_encodeN)rrrr*rrrrrsrc@seZdZddZdS)IncrementalDecoderc Cs|dkrtd||sdSt|}d}|rV|dsDd}|d=n|sV|d=|rVd}g}d}|D]*}|t||r|d7}|t|7}qbd||} |t|7}| |fSr)rrrr r!rrr"r#rrr_buffer_decodeAs0  z!IncrementalDecoder._buffer_decodeN)rrrr,rrrrr+@sr+c@s eZdZdS) StreamWriterNrrrrrrrr-bsr-c@s eZdZdS) StreamReaderNr.rrrrr/fsr/c Cs tjdtjtjttttdS)Nidna)namerrincrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInfor rrrr+r-r/rrrr getregentryjsr8)corerrrrrr6retypingrr compilerr BufferedIncrementalEncoderrBufferedIncrementalDecoderr+r-r/r8rrrrs ""