Skip to content

Commit 7b9cd1d

Browse files
InvalidOperationException is updated (typing) (#20)
- source returns typing.Optional[str] - __repr__ uses assert type(self) is InvalidOperationException - suppression of E721 is deleted
1 parent 304854a commit 7b9cd1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ def message(self) -> str:
4040
return self._message
4141

4242
@property
43-
def source(self) -> str:
43+
def source(self) -> typing.Optional[str]:
4444
assert self._source is None or type(self._source) is str
4545
return self._source
4646

4747
def __repr__(self) -> str:
4848
# It must be overrided!
49-
assert type(self) == InvalidOperationException # noqa: E721
49+
assert type(self) is InvalidOperationException
5050
r = "{}({}, {})".format(
5151
__class__.__name__,
5252
repr(self._message),

0 commit comments

Comments
 (0)