diff options
Diffstat (limited to 'djangorestframework/parsers.py')
| -rw-r--r-- | djangorestframework/parsers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index fc4450b7..0eb72f38 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -104,7 +104,7 @@ class YAMLParser(BaseParser): """ try: return (yaml.safe_load(stream), None) - except ValueError, exc: + except (ValueError, yaml.parser.ParserError), exc: raise ImmediateResponse( {'detail': 'YAML parse error - %s' % unicode(exc)}, status=status.HTTP_400_BAD_REQUEST) |
