From 6c9f40ff24f860077e5722bf9ad845e0c0be9518 Mon Sep 17 00:00:00 2001
From: rsiddharth <rsiddharth@ninthfloor.org>
Date: Mon, 2 Sep 2013 18:22:31 +0530
Subject: [PATCH] fixes a python2.6 specific issue related to OrderedDict.
In Python 2.6, OrderedDict is not part of `collections', by virtue of
which an ImportError is throw when
`mediagoblin/processing/__init__.py' imports OrderedDict from
'collections'. To fix this, we try importing OrderedDict from
collections, if it throws an ImportError (meaning python2.6 is in
use), we import OrderedDict from 'ordereddict'.
---
mediagoblin/processing/__init__.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py
index 361a973..7a9603b 100644
a
|
b
|
|
12 | 12 | # GNU Affero General Public License for more details. |
13 | 13 | # |
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
15 | | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/> |
16 | 16 | |
17 | | from collections import OrderedDict |
| 17 | try: |
| 18 | from collections import OrderedDict |
| 19 | except ImportError: |
| 20 | # Python 2.6 in use. |
| 21 | from ordereddict import OrderedDict |
18 | 22 | import logging |
19 | 23 | import os |
20 | 24 | |