aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/parsers.py
diff options
context:
space:
mode:
Diffstat (limited to 'djangorestframework/parsers.py')
-rw-r--r--djangorestframework/parsers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py
index 168d391e..2ff64bd3 100644
--- a/djangorestframework/parsers.py
+++ b/djangorestframework/parsers.py
@@ -108,7 +108,8 @@ if yaml:
except ValueError, exc:
raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
{'detail': 'YAML parse error - %s' % unicode(exc)})
-
+else:
+ YAMLParser = None
class PlainTextParser(BaseParser):
"""
@@ -172,4 +173,4 @@ DEFAULT_PARSERS = ( JSONParser,
MultiPartParser )
if YAMLParser:
- DEFAULT_PARSERS += (YAMLParser,)
+ DEFAULT_PARSERS += ( YAMLParser, )