aboutsummaryrefslogtreecommitdiff
path: root/src/IRCBuffer.py
diff options
context:
space:
mode:
authorGravatar Valentin Lorentz2019-10-26 00:32:00 +0200
committerGravatar Valentin Lorentz2019-10-30 22:26:59 +0100
commitfbf8cd1a167966d31717f4fc1fec1418910ad0f4 (patch)
tree07284824baa45a7ce0a79f64b9ba81f7e83d7793 /src/IRCBuffer.py
parentfix _line() related type hinting issues in IRCServer.py (diff)
signature
Fix type errors detected by 'mypy --ignore-missing-imports src'.
Diffstat (limited to 'src/IRCBuffer.py')
-rw-r--r--src/IRCBuffer.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/IRCBuffer.py b/src/IRCBuffer.py
index a809fdc4..f30b13ca 100644
--- a/src/IRCBuffer.py
+++ b/src/IRCBuffer.py
@@ -67,7 +67,11 @@ class Buffer(object):
return None
def find_from(self, nickname: str) -> typing.Optional[BufferLine]:
- return (self.find_many_from(nickname, 1) or [None])[0]
+ lines = self.find_many_from(nickname, 1)
+ if lines:
+ return lines[0]
+ else:
+ return None
def find_many_from(self, nickname: str, max: int
) -> typing.List[BufferLine]:
nickname_lower = self.server.irc_lower(nickname)