Skip to content

Commit 26e3d3c

Browse files
committed
Define exceptions with @attr.s(hash=True)
otherwise they don't work with the Python traceback machinery.
1 parent a8a6913 commit 26e3d3c

File tree

5 files changed

+200
-2
lines changed

5 files changed

+200
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build/
44
effect.egg-info/
55
dist/
66
*~
7+
.pytest_cache

Pipfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[requires]
9+
10+
python_version = "3.5"
11+
12+
13+
[packages]
14+
15+
six = "~=1.11.0"
16+
attrs = "~=17.4.0"
17+
18+
19+
[dev-packages]
20+
21+
pytest = "~=3.4.1"
22+
testtools = "~=2.3.0"
23+
"flake8" = "~=3.5.0"

Pipfile.lock

Lines changed: 174 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

effect/_intents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def parallel_all_errors(effects):
8787
return Effect(ParallelEffects(list(effects)))
8888

8989

90-
@attr.s
90+
@attr.s(hash=True)
9191
class FirstError(Exception):
9292
"""
9393
One of the effects in a :obj:`ParallelEffects` resulted in an error. This

effect/test_parallel_performers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ._test_utils import MatchesReraisedExcInfo, get_exc_info
1313

1414

15-
@attr.s
15+
@attr.s(hash=True)
1616
class EquitableException(Exception):
1717
message = attr.ib()
1818

0 commit comments

Comments
 (0)