Skip to content

Commit ee45b49

Browse files
authored
Merge pull request #363 from jspricke/topicdiff_python3
topicdiff.py 0.4: make script compatible with Python 3
2 parents 51252be + 1e90f91 commit ee45b49

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/topicdiff.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
import re
66

7-
from itertools import izip_longest
7+
try:
8+
from itertools import zip_longest
9+
except ImportError:
10+
from itertools import izip_longest as zip_longest
811

912
import weechat
1013

1114
SCRIPT_NAME = "topicdiff"
1215
SCRIPT_AUTHOR = "Dafydd Harries <daf@rhydd.org>"
13-
SCRIPT_VERSION = "0.3"
16+
SCRIPT_VERSION = "0.4"
1417
SCRIPT_LICENSE = "GPL3"
1518
SCRIPT_DESC = "Show differences between old and new topics."
1619

@@ -25,7 +28,7 @@ def topic_changed(buffer, new_topic):
2528
old_chunks = topic_chunks(topics[buffer])
2629
new_chunks = topic_chunks(new_topic)
2730

28-
for old_chunk, new_chunk in izip_longest(old_chunks, new_chunks):
31+
for old_chunk, new_chunk in zip_longest(old_chunks, new_chunks):
2932
if old_chunk and old_chunk not in new_chunks:
3033
weechat.prnt(buffer, '%s-\t%s' % (
3134
weechat.color('red'),

0 commit comments

Comments
 (0)