From 9bc5b0c7f7b670352fb48f14f835990748917fbe Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 3 Mar 2015 00:57:09 +0800 Subject: [PATCH] 2to3; ordereddict fallback was for python2.6 --- morss/feeds.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/morss/feeds.py b/morss/feeds.py index 4225aaa..1819854 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -21,10 +21,15 @@ json.encoder.c_make_encoder = None try: from collections import OrderedDict +except ImportError: + # python < 2.7 + from ordereddict import OrderedDict + +try: from StringIO import StringIO from urllib2 import urlopen except ImportError: - from ordereddict import OrderedDict + # python > 3 from io import StringIO from urllib.request import urlopen