mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed the exception handling when deserializing via generators on Python 2.5 that was introduced in r17469. Also only test the YAML serializer if PyYAML is installed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -40,6 +40,8 @@ def Deserializer(stream_or_string, **options):
|
||||
try:
|
||||
for obj in PythonDeserializer(simplejson.load(stream), **options):
|
||||
yield obj
|
||||
except GeneratorExit:
|
||||
raise
|
||||
except Exception, e:
|
||||
# Map to deserializer error
|
||||
raise DeserializationError(e)
|
||||
|
||||
@@ -55,6 +55,8 @@ def Deserializer(stream_or_string, **options):
|
||||
try:
|
||||
for obj in PythonDeserializer(yaml.safe_load(stream), **options):
|
||||
yield obj
|
||||
except GeneratorExit:
|
||||
raise
|
||||
except Exception, e:
|
||||
# Map to deserializer error
|
||||
raise DeserializationError(e)
|
||||
|
||||
Reference in New Issue
Block a user