summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 22:00:32 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 22:00:40 +0200
commitd626aa15339de2e573dd0ac7b20f54406210f76f (patch)
treeeb75aeea630cead969c5b429485a5bbdbfb3ff86
parent08d31d4fc74913a7f6998bfda0de9da2d8d05bbd (diff)
downloadpoezio-d626aa15339de2e573dd0ac7b20f54406210f76f.tar.gz
poezio-d626aa15339de2e573dd0ac7b20f54406210f76f.tar.bz2
poezio-d626aa15339de2e573dd0ac7b20f54406210f76f.tar.xz
poezio-d626aa15339de2e573dd0ac7b20f54406210f76f.zip
Fix truncate_nick()’s types to include None.
It is relied on in quite a few places which don’t check for None before calling it on messages which have no nick.
-rw-r--r--poezio/windows/funcs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/poezio/windows/funcs.py b/poezio/windows/funcs.py
index 69edace2..22977374 100644
--- a/poezio/windows/funcs.py
+++ b/poezio/windows/funcs.py
@@ -22,7 +22,7 @@ def find_first_format_char(text: str,
return pos
-def truncate_nick(nick: str, size=10) -> str:
+def truncate_nick(nick: Optional[str], size=10) -> Optional[str]:
if size < 1:
size = 1
if nick and len(nick) > size: