diff --git a/Makefile b/Makefile index a589117..1278ac4 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,5 @@ $(DESTDIR)$(PREFIX)/python/matrix/%.py: matrix/%.py phony install -Dm644 $< $@ test: - $(PYTHON) -m pytest + python3 -m pytest + python2 -m pytest diff --git a/matrix/_weechat.py b/matrix/_weechat.py index f4677f2..7b17d8c 100644 --- a/matrix/_weechat.py +++ b/matrix/_weechat.py @@ -74,16 +74,15 @@ def color(color_name): escape_codes.append( make_fg_color(weechat_base_colors[stripped_color])) - elif stripped_color.isdecimal(): + elif stripped_color.isdigit(): num_color = int(stripped_color) if num_color >= 0 and num_color < 256: escape_codes.append(make_fg_color(stripped_color)) - if bg_color in weechat_base_colors: escape_codes.append(make_bg_color(weechat_base_colors[bg_color])) else: - if bg_color.isdecimal(): + if bg_color.isdigit(): num_color = int(bg_color) if num_color >= 0 and num_color < 256: escape_codes.append(make_bg_color(bg_color)) diff --git a/tests/color_test.py b/tests/color_test.py index 9f86d5e..749f855 100644 --- a/tests/color_test.py +++ b/tests/color_test.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + import webcolors from hypothesis import given from hypothesis.strategies import sampled_from