Fix Python 2.6 support (broken in the two last commits).

This commit is contained in:
Valentin Lorentz 2014-07-31 18:06:20 +00:00
parent 8be1671867
commit 2f327ab9c1
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ import sys
import feedparser import feedparser
from supybot.test import * from supybot.test import *
import supybot.conf as conf import supybot.conf as conf
if sys.version_info.major >= 3: if sys.version_info[0] >= 3:
from io import StringIO from io import StringIO
else: else:
from cStringIO import StringIO from cStringIO import StringIO

View File

@ -448,7 +448,7 @@ def format(s, *args, **kwargs):
# to add the character to the _formatRe regexp or it will be ignored # to add the character to the _formatRe regexp or it will be ignored
# (and hard to debug if you don't know the trick). # (and hard to debug if you don't know the trick).
# Of course, you should also document it in the docstring above. # 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): def pred(s):
if isinstance(s, unicode): if isinstance(s, unicode):
return s.encode('utf8') return s.encode('utf8')