From 67edf8666049e518a8a98c996a0ff992a553d7da Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Thu, 2 Oct 2014 17:50:17 +0300 Subject: [PATCH] Added a fix for Python 3.2 which has an lru_cache that doesn't support typing. --- rest_framework/compat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 8de0496c6..5d1c410c7 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -311,9 +311,11 @@ except ImportError: klass.__str__ = lambda self: self.__unicode__().encode('utf-8') return klass -try: + +import sys +if sys.version_info >= (3, 3): from functools import lru_cache -except ImportError: +else: try: from backports.functools_lru_cache import lru_cache except ImportError: