From ccf071f9a7e8e6c69f8853f4f37758bdc71dd872 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Thu, 27 Mar 2014 13:07:47 +0100 Subject: [PATCH] Fallback to OrderedDict from ordereddict --- rest_framework/compat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index da276b40f..7f9800202 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -601,6 +601,10 @@ except ImportError: return klass if django.VERSION >= (1, 7): - from collections import OrderedDict + try: + from collections import OrderedDict + except ImportError: + # Fall-back to OrderedDict from ordereddict module + from ordereddict import OrderedDict else: from django.utils.datastructures import SortedDict as OrderedDict