diff options
| author | konarkmodi <modi.konark@gmail.com> | 2013-03-19 10:34:59 +0530 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2013-03-19 15:42:39 -0700 |
| commit | bc4111ba68e5eede1f68882a16d68441a845e30b (patch) | |
| tree | 0b7689470b8ff28cdaee5fbe5053b81c720fd497 /django/core/serializers/pyyaml.py | |
| parent | 1fe90b281baa1601e4582fd9454b92740e527d89 (diff) | |
Fixed #18003 -- Preserved tracebacks when re-raising errors.
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
Diffstat (limited to 'django/core/serializers/pyyaml.py')
| -rw-r--r-- | django/core/serializers/pyyaml.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/serializers/pyyaml.py b/django/core/serializers/pyyaml.py index 27239e0445..478f14b53f 100644 --- a/django/core/serializers/pyyaml.py +++ b/django/core/serializers/pyyaml.py @@ -6,6 +6,7 @@ Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. import decimal import yaml +import sys from io import StringIO from django.db import models @@ -71,4 +72,4 @@ def Deserializer(stream_or_string, **options): raise except Exception as e: # Map to deserializer error - raise DeserializationError(e) + six.reraise(DeserializationError, DeserializationError(e), sys.exc_info()[2]) |
