mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #28575 -- Allowed pickling Model.DoesNotExist and MultipleObjectsReturned classes.
This commit is contained in:
@@ -64,6 +64,8 @@ def subclass_exception(name, parents, module, attached_to=None):
|
||||
|
||||
class_dict['__reduce__'] = __reduce__
|
||||
class_dict['__setstate__'] = __setstate__
|
||||
if attached_to:
|
||||
class_dict['__qualname__'] = '%s.%s' % (attached_to.__qualname__, name)
|
||||
|
||||
return type(name, parents, class_dict)
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ class ParallelTestSuite(unittest.TestSuite):
|
||||
- make tracebacks picklable with tblib, if available
|
||||
|
||||
Even with tblib, errors may still occur for dynamically created
|
||||
exception classes such Model.DoesNotExist which cannot be unpickled.
|
||||
exception classes which cannot be unpickled.
|
||||
"""
|
||||
counter = multiprocessing.Value(ctypes.c_int, 0)
|
||||
pool = multiprocessing.Pool(
|
||||
|
||||
Reference in New Issue
Block a user