diff --git a/morss/crawler.py b/morss/crawler.py index 0d2b625..fc80ac0 100644 --- a/morss/crawler.py +++ b/morss/crawler.py @@ -208,7 +208,7 @@ class BaseCacheHandler(BaseHandler): def _load(self, url): out = list(self.load(url)) - if sys.version_info[0] > '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())) diff --git a/morss/feeds.py b/morss/feeds.py index 7ccb9a9..56bca2a 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -380,7 +380,7 @@ class FeedParser(FeedBase): out = StringIO() c = csv.writer(out, dialect=csv.excel) for item in self.items: - if sys.version_info[0] > '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]