From 2f327ab9c1d8932f950488c31a8da1522fc0f85f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 31 Jul 2014 18:06:20 +0000 Subject: [PATCH] Fix Python 2.6 support (broken in the two last commits). --- plugins/RSS/test.py | 2 +- src/utils/str.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/RSS/test.py b/plugins/RSS/test.py index fa1dec66c..3b201a22a 100644 --- a/plugins/RSS/test.py +++ b/plugins/RSS/test.py @@ -32,7 +32,7 @@ import sys import feedparser from supybot.test import * import supybot.conf as conf -if sys.version_info.major >= 3: +if sys.version_info[0] >= 3: from io import StringIO else: from cStringIO import StringIO diff --git a/src/utils/str.py b/src/utils/str.py index f3003b43a..d9ca25f66 100644 --- a/src/utils/str.py +++ b/src/utils/str.py @@ -448,7 +448,7 @@ def format(s, *args, **kwargs): # to add the character to the _formatRe regexp or it will be ignored # (and hard to debug if you don't know the trick). # Of course, you should also document it in the docstring above. - if sys.version_info.major < 3: + if sys.version_info[0] < 3: def pred(s): if isinstance(s, unicode): return s.encode('utf8')