
¿«‘_�  ã               @   s¨   d  d l  m Z d  d l  m Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd	 d
 „  d
 e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z	 d S)é   )ÚPY2)Ú	text_typec                   sR   e  Z d  Z d Z d Z ‡  f d d †  Z d d „  Z e rN e Z d d „  Z ‡  S)ÚBadDataz“Raised if bad data of any sort was encountered. This is the base
    for all exceptions that itsdangerous defines.

    .. versionadded:: 0.15
    Nc                s&   t  t |  ƒ j |  | ƒ | |  _ d  S)N)Úsuperr   Ú__init__Úmessage)Úselfr   )Ú	__class__© ú8/tmp/pip-build-5gj8f0j9/itsdangerous/itsdangerous/exc.pyr      s    zBadData.__init__c             C   s   t  |  j ƒ S)N)r   r   )r   r
   r
   r   Ú__str__   s    zBadData.__str__c             C   s   |  j  ƒ  j d ƒ S)Nzutf-8)Ú__unicode__Úencode)r   r
   r
   r   r      s    )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r
   r
   )r	   r   r      s   r   c               @   s%   e  Z d  Z d Z d d d „ Z d S)ÚBadSignaturez%Raised if a signature does not match.Nc             C   s   t  j |  | ƒ | |  _ d  S)N)r   r   Úpayload)r   r   r   r
   r
   r   r      s    zBadSignature.__init__)r   r   r   r   r   r
   r
   r
   r   r      s   r   c               @   s(   e  Z d  Z d Z d d d d „ Z d S)ÚBadTimeSignaturezbRaised if a time-based signature is invalid. This is a subclass
    of :class:`BadSignature`.
    Nc             C   s    t  j |  | | ƒ | |  _ d  S)N)r   r   Údate_signed)r   r   r   r   r
   r
   r   r   /   s    zBadTimeSignature.__init__)r   r   r   r   r   r
   r
   r
   r   r   *   s   r   c               @   s   e  Z d  Z d Z d S)ÚSignatureExpiredzrRaised if a signature timestamp is older than ``max_age``. This
    is a subclass of :exc:`BadTimeSignature`.
    N)r   r   r   r   r
   r
   r
   r   r   :   s   r   c               @   s+   e  Z d  Z d Z d d d d d „ Z d S)Ú	BadHeaderz®Raised if a signed header is invalid in some form. This only
    happens for serializers that have a header that goes with the
    signature.

    .. versionadded:: 0.24
    Nc             C   s)   t  j |  | | ƒ | |  _ | |  _ d  S)N)r   r   ÚheaderÚoriginal_error)r   r   r   r   r   r
   r
   r   r   H   s    	zBadHeader.__init__)r   r   r   r   r   r
   r
   r
   r   r   @   s   r   c               @   s%   e  Z d  Z d Z d d d „ Z d S)Ú
BadPayloada4  Raised if a payload is invalid. This could happen if the payload
    is loaded despite an invalid signature, or if there is a mismatch
    between the serializer and deserializer. The original exception
    that occurred during loading is stored on as :attr:`original_error`.

    .. versionadded:: 0.15
    Nc             C   s   t  j |  | ƒ | |  _ d  S)N)r   r   r   )r   r   r   r
   r
   r   r   ]   s    zBadPayload.__init__)r   r   r   r   r   r
   r
   r
   r   r   T   s   r   N)
Ú_compatr   r   Ú	Exceptionr   r   r   r   r   r   r
   r
   r
   r   Ú<module>   s   