Skip to content

Commit fd13d87

Browse files
authored
Merge pull request #18 from RazerM/fix-inheritance
Fix Value and Error inheritance on Python 3.5+
2 parents 4ec1933 + 733667d commit fd13d87

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/outcome/_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ async def asend(self, agen):
4848
"""
4949

5050

51-
class Value(ValueBase):
51+
class Value(Outcome, ValueBase):
5252
async def asend(self, agen):
5353
self._set_unwrapped()
5454
return await agen.asend(self.value)
5555

5656

57-
class Error(ErrorBase):
57+
class Error(Outcome, ErrorBase):
5858
async def asend(self, agen):
5959
self._set_unwrapped()
6060
return await agen.athrow(self.error)

tests/test_sync.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ def raise_ValueError(x):
103103
assert type(e) == Error
104104
assert type(e.error) is ValueError
105105
assert e.error.args == ("two",)
106+
107+
108+
def test_inheritance():
109+
assert issubclass(Value, outcome.Outcome)
110+
assert issubclass(Error, outcome.Outcome)

0 commit comments

Comments
 (0)