Support python 2.6 again! Thanks to julianoliver for catching this.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 9 Sep 2013 15:01:56 +0000 (10:01 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 9 Sep 2013 15:06:59 +0000 (10:06 -0500)
This commit sponsored by Sam Clegg.  Thank you!

mediagoblin/processing/__init__.py

index bdbe0441bda352970bb748d180801fd68c9be8cc..246091d61481c976e629cbf9f7b2b804a98e46be 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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):
         """