diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-09-09 10:01:56 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-09-09 10:06:59 -0500 |
commit | 66cafc3b74d476710013efb46341b989028f3057 (patch) | |
tree | 75ba76583e84334d6961780d1675323f2efb7ab8 /mediagoblin/processing | |
parent | 0485e9c892d712534592733cdc302ec28c841293 (diff) | |
download | mediagoblin-66cafc3b74d476710013efb46341b989028f3057.tar.lz mediagoblin-66cafc3b74d476710013efb46341b989028f3057.tar.xz mediagoblin-66cafc3b74d476710013efb46341b989028f3057.zip |
Support python 2.6 again! Thanks to julianoliver for catching this.
This commit sponsored by Sam Clegg. Thank you!
Diffstat (limited to 'mediagoblin/processing')
-rw-r--r-- | mediagoblin/processing/__init__.py | 13 |
1 files changed, 11 insertions, 2 deletions
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 <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): """ |