mercurial/thirdparty/attr/exceptions.py
changeset 34397 765eb17a7eb8
child 49643 e1c586b9a43c
equal deleted inserted replaced
34396:9fb9f8440b71 34397:765eb17a7eb8
       
     1 from __future__ import absolute_import, division, print_function
       
     2 
       
     3 
       
     4 class FrozenInstanceError(AttributeError):
       
     5     """
       
     6     A frozen/immutable instance has been attempted to be modified.
       
     7 
       
     8     It mirrors the behavior of ``namedtuples`` by using the same error message
       
     9     and subclassing :exc:`AttributeError`.
       
    10 
       
    11     .. versionadded:: 16.1.0
       
    12     """
       
    13     msg = "can't set attribute"
       
    14     args = [msg]
       
    15 
       
    16 
       
    17 class AttrsAttributeNotFoundError(ValueError):
       
    18     """
       
    19     An ``attrs`` function couldn't find an attribute that the user asked for.
       
    20 
       
    21     .. versionadded:: 16.2.0
       
    22     """
       
    23 
       
    24 
       
    25 class NotAnAttrsClassError(ValueError):
       
    26     """
       
    27     A non-``attrs`` class has been passed into an ``attrs`` function.
       
    28 
       
    29     .. versionadded:: 16.2.0
       
    30     """
       
    31 
       
    32 
       
    33 class DefaultAlreadySetError(RuntimeError):
       
    34     """
       
    35     A default has been set using ``attr.ib()`` and is attempted to be reset
       
    36     using the decorator.
       
    37 
       
    38     .. versionadded:: 17.1.0
       
    39     """