Mercurial > hg
comparison mercurial/thirdparty/attr/exceptions.py @ 34397:765eb17a7eb8
thirdparty: vendor attrs
The attrs package allows defining namedtuple-like classes with no weird
behavior and no runtime performance cost.
This patch vendors in attrs 17.2.0.
# no-check-commit
Differential Revision: https://phab.mercurial-scm.org/D867
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 01 Oct 2017 04:14:16 -0700 |
parents | |
children | e1c586b9a43c |
comparison
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 """ |