ó
î%![c           @   sï  d  Z  d d l m Z d e f d     YZ d e f d     YZ d e f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ	 d e f d     YZ
 d e
 f d     YZ d e f d     YZ d e f d     YZ d e
 f d     YZ d e
 f d     YZ d e f d     YZ d e
 f d     YZ d e f d      YZ d! e f d"     YZ d# e f d$     YZ d% e f d&     YZ d' e f d(     YZ e j Z e j Z e j Z e Z e Z e Z e Z  d) S(*   s<   this module contains exceptions used in the astroid library
iĸĸĸĸ(   t   utilt   AstroidErrorc           B   s#   e  Z d  Z d d  Z d   Z RS(   sm  base exception class for all astroid related exceptions

    AstroidError and its subclasses are structured, intended to hold
    objects representing state when the exception is thrown.  Field
    values are passed to the constructor as keyword-only arguments.
    Each subclass has its own set of standard fields, but use your
    best judgment to decide whether a specific exception instance
    needs more or fewer fields for debugging.  Field values may be
    used to lazily generate the error message: self.message.format()
    will be called with the field names and values supplied as keyword
    arguments.
    t    c         K   sP   t  t |   j |  | |  _ x* | j   D] \ } } t |  | |  q, Wd  S(   N(   t   superR   t   __init__t   messaget   itemst   setattr(   t   selfR   t   kwst   keyt   value(    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR      s    	c         C   s   |  j  j t |     S(   N(   R   t   formatt   vars(   R   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyt   __str__!   s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR      s   t   AstroidBuildingErrorc           B   s   e  Z d  Z d d  Z RS(   sß   exception class when we are unable to build an astroid representation

    Standard attributes:
        modname: Name of the module that AST construction failed for.
        error: Exception raised during construction.
    s"   Failed to import module {modname}.c         K   s   t  t |   j | |  d  S(   N(   R   R   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   -   s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   %   s   t   AstroidImportErrorc           B   s   e  Z d  Z RS(   s@   Exception class used when a module can't be imported by astroid.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   1   s   t   TooManyLevelsErrorc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   sî   Exception class which is raised when a relative import was beyond the top-level.

    Standard attributes:
        level: The level which was attempted.
        name: the name of the module on which the relative import was attempted.
    sB   Relative import with too many levels ({level}) for module {name!r}c         K   s   t  t |   j | |  d  S(   N(   R   R   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   ?   s    N(   R   R   R   t   Nonet   levelt   nameR   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   5   s   t   AstroidSyntaxErrorc           B   s   e  Z d  Z RS(   s3   Exception class used when a module can't be parsed.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   D   s   t	   NoDefaultc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   sÃ   raised by function's `default_value` method when an argument has
    no default value

    Standard attributes:
        func: Function node.
        name: Name of argument without a default.
    s%   {func!r} has no default for {name!r}.c         K   s   t  t |   j | |  d  S(   N(   R   R   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   S   s    N(   R   R   R   R   t   funcR   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   H   s   t   ResolveErrorc           B   s   e  Z d  Z d Z RS(   sŠ   Base class of astroid resolution/inference error.

    ResolveError is not intended to be raised.

    Standard attributes:
        context: InferenceContext object.
    N(   R   R   R   R   t   context(    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   W   s   t   MroErrorc           B   s#   e  Z d  Z d Z d Z d   Z RS(   s	  Error raised when there is a problem with method resolution of a class.

    Standard attributes:
        mros: A sequence of sequences containing ClassDef nodes.
        cls: ClassDef node whose MRO resolution failed.
        context: InferenceContext object.
    c         C   s8   d j  d   |  j D  } |  j j d | d |  j  S(   Ns   , c         s   s1   |  ]' } d  j  d j d   | D   Vq d S(   s   ({})s   , c         s   s   |  ] } | j  Vq d  S(   N(   R   (   t   .0t   b(    (    s1   lib/python2.7/site-packages/astroid/exceptions.pys	   <genexpr>n   s    N(   R   t   join(   R   t   m(    (    s1   lib/python2.7/site-packages/astroid/exceptions.pys	   <genexpr>n   s   t   mrost   cls(   R    R"   R   R   R#   (   R   t	   mro_names(    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   m   s    (    N(   R   R   R   R"   R   R#   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   b   s   t   DuplicateBasesErrorc           B   s   e  Z d  Z RS(   sD   Error raised when there are duplicate bases in the same class bases.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR%   s   s   t   InconsistentMroErrorc           B   s   e  Z d  Z RS(   s0   Error raised when a class's MRO is inconsistent.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR&   w   s   t
   SuperErrorc           B   s   e  Z d  Z d Z d   Z RS(   sū   Error raised when there is a problem with a super call.

    Standard attributes:
        super_: The Super instance that raised the exception.
        context: InferenceContext object.
    c         C   s   |  j  j t |  j    S(   N(   R   R   R   t   super_(   R   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR      s    N(   R   R   R   R   R(   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR'   {   s   t   InferenceErrorc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   sĒ   raised when we are unable to infer a node

    Standard attributes:
        node: The node inference was called on.
        context: InferenceContext object.
    s   Inference failed for {node!r}.c         K   s   t  t |   j | |  d  S(   N(   R   R)   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR      s    N(   R   R   R   R   t   nodeR   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR)      s   t   NameInferenceErrorc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Raised when a name lookup fails, corresponds to NameError.

    Standard attributes:
        name: The name for which lookup failed, as a string.
        scope: The node representing the scope in which the lookup occurred.
        context: InferenceContext object.
    s    {name!r} not found in {scope!r}.c         K   s   t  t |   j | |  d  S(   N(   R   R+   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   Ī   s    N(   R   R   R   R   R   t   scopeR   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR+      s   t   AttributeInferenceErrorc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Raised when an attribute lookup fails, corresponds to AttributeError.

    Standard attributes:
        target: The node for which lookup failed.
        attribute: The attribute for which lookup failed, as a string.
        context: InferenceContext object.
    s&   {attribute!r} not found on {target!r}.c         K   s   t  t |   j | |  d  S(   N(   R   R-   R   (   R   R   R	   (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR   ģ   s    N(   R   R   R   R   t   targett	   attributeR   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR-   Ļ   s   t   UseInferenceDefaultc           B   s   e  Z d  Z RS(   sx   exception to be raised in custom inference function to indicate that it
    should go back to the default behaviour
    (   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR0   ·   s   t   _NonDeducibleTypeHierarchyc           B   s   e  Z d  Z RS(   sR   Raised when is_subtype / is_supertype can't deduce the relation between two types.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR1   ―   s   t   AstroidIndexErrorc           B   s   e  Z d  Z RS(   s@   Raised when an Indexable / Mapping does not have an index / key.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR2   Á   s   t   AstroidTypeErrorc           B   s   e  Z d  Z RS(   s9   Raised when a TypeError would be expected in Python code.(   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR3   Å   s   t   InferenceOverwriteErrorc           B   s   e  Z d  Z RS(   sX   Raised when an inference tip is overwritten

    Currently only used for debugging.
    (   R   R   R   (    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyR4   É   s   N(!   R   t   astroidR    t	   ExceptionR   R   R   R   R   R   R   R   R%   R&   R'   R)   R+   R-   R0   R1   R2   R3   R4   t   BadOperationMessaget   OperationErrort   BadUnaryOperationMessaget   UnaryOperationErrort   BadBinaryOperationMessaget   BinaryOperationErrort   SuperArgumentTypeErrort   UnresolvableNamet   NotFoundErrort   AstroidBuildingException(    (    (    s1   lib/python2.7/site-packages/astroid/exceptions.pyt   <module>
   s6   			