mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Merge pull request #889 from Mkaysi/fortune
Unix: fix fortune on Python 3
This commit is contained in:
commit
4c5b8c51d1
@ -221,8 +221,12 @@ class Unix(callbacks.Plugin):
|
||||
'not available.'), Raise=True)
|
||||
(out, err) = inst.communicate()
|
||||
inst.wait()
|
||||
lines = out.splitlines()
|
||||
lines = list(map(str.rstrip, lines))
|
||||
if sys.version_info[0] > 2:
|
||||
lines = [i.decode('utf-8').rstrip() for i in out.splitlines()]
|
||||
lines = list(map(str, lines))
|
||||
else:
|
||||
lines = out.splitlines()
|
||||
lines = list(map(str.rstrip, lines))
|
||||
lines = filter(None, lines)
|
||||
irc.replies(lines, joiner=' ')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user