diff options
Diffstat (limited to 'djangorestframework/compat.py')
| -rw-r--r-- | djangorestframework/compat.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/djangorestframework/compat.py b/djangorestframework/compat.py index b818b446..e81b428f 100644 --- a/djangorestframework/compat.py +++ b/djangorestframework/compat.py @@ -465,3 +465,9 @@ except: from django.core.urlresolvers import reverse from django.utils.functional import lazy reverse_lazy = lazy(reverse, str) + +# xml.etree.parse only throws ParseError for python >= 2.7 +try: + from xml.etree import ParseError as ETParseError +except ImportError: # python < 2.7 + ETParseError = None |
