Correct Python version check
parent
098a306c91
commit
8656e53b84
|
@ -208,7 +208,7 @@ class BaseCacheHandler(BaseHandler):
|
|||
def _load(self, url):
|
||||
out = list(self.load(url))
|
||||
|
||||
if sys.version > '3':
|
||||
if sys.version_info[0] > '3':
|
||||
out[2] = email.message_from_string(out[2] or unicode()) # headers
|
||||
else:
|
||||
out[2] = mimetools.Message(StringIO(out[2] or unicode()))
|
||||
|
|
|
@ -380,7 +380,7 @@ class FeedParser(FeedBase):
|
|||
out = StringIO()
|
||||
c = csv.writer(out, dialect=csv.excel)
|
||||
for item in self.items:
|
||||
if sys.version > '3':
|
||||
if sys.version_info[0] > '3':
|
||||
row = [x[1] for x in item]
|
||||
else:
|
||||
row = [x[1].encode('utf-8') if isinstance(x[1], unicode) else x[1] for x in item]
|
||||
|
|
Loading…
Reference in New Issue