
     f                     "   d dl mZmZmZmZmZmZmZmZ g dZ	 G d de
          Z G d de          Z G d de          Z	 dd
ee         dedededeeef         f
dZ edd          Z G d de          Zdeeeeeef         defdZdS )    )AnyDictNoReturnPatternTupleTypeTypeVarUnion)ProtocolErrorLocalProtocolErrorRemoteProtocolErrorvalidatebytesifyc                   (    e Zd ZdZddededdfdZdS )	r   aM  Exception 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.

      msgerror_status_hintreturnNc                     t          |           t          u rt          d          t                              | |           || _        d S )Nz+tried to directly instantiate ProtocolError)typer   	TypeError	Exception__init__r   )selfr   r   s      L/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/h11/_util.pyr   zProtocolError.__init__)   sF    ::&&IJJJ4%%%!2    )r   )__name__
__module____qualname____doc__strintr    r   r   r   r      sL         83 3C 3C 3$ 3 3 3 3 3 3r   r   c                       e Zd ZdefdZdS )r   r   c                     t           | _        | N)r   	__class__r   s    r   !_reraise_as_remote_protocol_errorz4LocalProtocolError._reraise_as_remote_protocol_error<   s     - 
r   N)r   r   r   r   r)   r#   r   r   r   r   ;   s/        8      r   r   c                       e Zd ZdS )r   N)r   r   r   r#   r   r   r   r   P   s        Dr   r   malformed dataregexdatar   format_argsr   c                     |                      |          }|s|r
 |j        | }t          |          |                                S r&   )	fullmatchformatr   	groupdict)r,   r-   r   r.   matchs        r   r   r   T   sQ     OOD!!E & 	+#*k*C %%%??r   _T_SentinelSentinel)boundc                   p     e Zd Zdee         dedeedf         deee	f         de	def fdZ
defd	Z xZS )
r5   clsnamebases.	namespacekwdsr   c                 l    |t           fk    sJ  t                      j        | |||fi |}||_        |S r&   )r5   super__new__r'   )r8   r9   r:   r;   r<   vr'   s         r   r?   zSentinel.__new__l   sG     ####EGGOCui@@4@@r   c                     | j         S r&   )r   r(   s    r   __repr__zSentinel.__repr__x   s
    }r   )r   r   r   r   r4   r!   r   r   r   r   r?   rB   __classcell__)r'   s   @r   r5   r5   k   s        
+

 T3Y
 S>	

 
 

 
 
 
 
 
#        r   sc                     t          |           t          u r| S t          | t                    r|                     d          } t          | t
                    rt          d          t          |           S )Nasciiz#expected bytes-like object, not int)r   bytes
isinstancer!   encoder"   r   )rD   s    r   r   r      sg    Aww%!S HHW!S ?=>>>88Or   N)r+   )typingr   r   r   r   r   r   r	   r
   __all__r   r   r   r   rG   r!   r   r4   r   r5   	bytearray
memoryviewr"   r   r#   r   r   <module>rN      s   L L L L L L L L L L L L L L L L L L L L  !3 !3 !3 !3 !3I !3 !3 !3^       *	 	 	 	 	- 	 	 	
 4D 5>!&-0SV	#u*   ( gm:666    t   (eY
C<= %      r   