zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
U
M±dã@sÈddlmZmZmZmZmZmZmZmZdddddgZ    Gdd„de
ƒZ Gdd„de ƒZ Gd    d„de ƒZ deeeeeeeefd œd d„Zed ddZGdd„deƒZeeeeeefedœdd„ZdS)é)ÚAnyÚDictÚNoReturnÚPatternÚTupleÚTypeÚTypeVarÚUnionÚ ProtocolErrorÚLocalProtocolErrorÚRemoteProtocolErrorÚvalidateÚbytesifyc@s$eZdZdZdeeddœdd„ZdS)r
aMException indicating a violation of the HTTP/1.1 protocol.
 
    This as an abstract base class, with two concrete base classes:
    :exc:`LocalProtocolError`, which indicates that you tried to do something
    that HTTP/1.1 says is illegal, and :exc:`RemoteProtocolError`, which
    indicates that the remote peer tried to do something that HTTP/1.1 says is
    illegal. See :ref:`error-handling` for details.
 
    In addition to the normal :exc:`Exception` features, it has one attribute:
 
    .. attribute:: error_status_hint
 
       This gives a suggestion as to what status code a server might use if
       this error occurred as part of a request.
 
       For a :exc:`RemoteProtocolError`, this is useful as a suggestion for
       how you might want to respond to a misbehaving peer, if you're
       implementing a server.
 
       For a :exc:`LocalProtocolError`, this can be taken as a suggestion for
       how your peer might have responded to *you* if h11 had allowed you to
       continue.
 
       The default is 400 Bad Request, a generic catch-all for protocol
       violations.
 
    éN)ÚmsgÚerror_status_hintÚreturncCs*t|ƒtkrtdƒ‚t ||¡||_dS)Nz+tried to directly instantiate ProtocolError)Útyper
Ú    TypeErrorÚ    ExceptionÚ__init__r)Úselfrr©rú@d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\h11/_util.pyr)s  zProtocolError.__init__)r)Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚstrÚintrrrrrr
sc@seZdZedœdd„ZdS)r ©rcCst|_|‚dS©N)r Ú    __class__©rrrrÚ!_reraise_as_remote_protocol_error<s
z4LocalProtocolError._reraise_as_remote_protocol_errorN)rrrrr$rrrrr ;sc@s eZdZdS)r N)rrrrrrrr Psúmalformed data)ÚregexÚdatarÚ format_argsrcGs,| |¡}|s$|r|j|Ž}t|ƒ‚| ¡Sr!)Ú    fullmatchÚformatr Ú    groupdict)r&r'rr(Úmatchrrrr Ts 
 
Ú _T_SentinelÚSentinel)ÚboundcsNeZdZeeeeedfeee    fe    edœ‡fdd„ Z
edœdd„Z ‡Z S)r..)ÚclsÚnameÚbasesÚ    namespaceÚkwdsrc s.|tfkst‚tƒj||||f|Ž}||_|Sr!)r.ÚAssertionErrorÚsuperÚ__new__r")r0r1r2r3r4Úv©r"rrr7lszSentinel.__new__r cCs|jSr!)rr#rrrÚ__repr__xszSentinel.__repr__) rrrrr-rrrrrr7r:Ú __classcell__rrr9rr.ks
 
ú )ÚsrcCs>t|ƒtkr|St|tƒr$| d¡}t|tƒr6tdƒ‚t|ƒS)NÚasciiz#expected bytes-like object, not int)rÚbytesÚ
isinstancerÚencoderr)r<rrrrs 
 
 
N)r%)Útypingrrrrrrrr    Ú__all__rr
r r r>rr r-rr.Ú    bytearrayÚ
memoryviewrrrrrrÚ<module>s((û    /ÿ
þ