From: Christopher Allan Webber Date: Mon, 9 Sep 2013 15:01:56 +0000 (-0500) Subject: Support python 2.6 again! Thanks to julianoliver for catching this. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=66cafc3b74d476710013efb46341b989028f3057;p=mediagoblin.git Support python 2.6 again! Thanks to julianoliver for catching this. This commit sponsored by Sam Clegg. Thank you! --- diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index bdbe0441..246091d6 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -14,7 +14,13 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from collections import OrderedDict +# Use an ordered dict if we can. If not, we'll just use a normal dict +# later. +try: + from collections import OrderedDict +except: + OrderedDict = None + import logging import os @@ -187,7 +193,10 @@ class ProcessingManager(object): """ def __init__(self): # Dict of all MediaProcessors of this media type - self.processors = OrderedDict() + if OrderedDict is not None: + self.processors = OrderedDict() + else: + self.processors = {} def add_processor(self, processor): """