
    Wh#                         g d Z  G d de          Z G d de          Z G d de          ZddZ G d	 d
e          Zd Zd Z	dS ))ProtocolErrorLocalProtocolErrorRemoteProtocolErrorvalidatemake_sentinelbytesifyc                       e Zd ZdZd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.

      c                     t          |           t          u rt          d          t                              | |           || _        d S )Nz+tried to directly instantiate ProtocolError)typer   	TypeError	Exception__init__error_status_hint)selfmsgr   s      O/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/h11/_util.pyr   zProtocolError.__init__(   sF    ::&&IJJJ4%%%!2    N)r	   )__name__
__module____qualname____doc__r    r   r   r   r      s2         83 3 3 3 3 3r   r   c                       e Zd Zd ZdS )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   :   s#            r   r   c                       e Zd ZdS )r   N)r   r   r   r   r   r   r   r   O   s        Dr   r   malformed datac                     |                      |          }|s|r
 |j        | }t          |          |                                S r   )	fullmatchformatr   	groupdict)regexdatar   format_argsmatchs        r   r   r   S   sO    OOD!!E & 	+#*k*C %%%??r   c                       e Zd Zd ZdS )_SentinelBasec                     | j         S r   )r   r   s    r   __repr__z_SentinelBase.__repr__e   s
    }r   N)r   r   r   r,   r   r   r   r*   r*   d   s#            r   r*   c                 B    t          | t           fi           }||_        |S r   )r*   r   )nameclss     r   r   r   i   s"    
}.
3
3CCMJr   c                     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
isinstancestrencodeintr   )ss    r   r   r   r   sg    Aww%!S HHW!S ?=>>>88Or   N)r    )
__all__r   r   r   r   r   r   r*   r   r   r   r   r   <module>r9      s     !3 !3 !3 !3 !3I !3 !3 !3^       *	 	 	 	 	- 	 	 	   "    D   
      r   