Refs #23919 -- Removed __traceback__ setting needed for Python 2.
Partially reverted refs #25761 and refs #16245.
This commit is contained in:
parent
e5c2e43cc8
commit
435e4bf38e
|
@ -83,8 +83,6 @@ class DatabaseErrorWrapper:
|
||||||
if issubclass(exc_type, db_exc_type):
|
if issubclass(exc_type, db_exc_type):
|
||||||
dj_exc_value = dj_exc_type(*exc_value.args)
|
dj_exc_value = dj_exc_type(*exc_value.args)
|
||||||
dj_exc_value.__cause__ = exc_value
|
dj_exc_value.__cause__ = exc_value
|
||||||
if not hasattr(exc_value, '__traceback__'):
|
|
||||||
exc_value.__traceback__ = traceback
|
|
||||||
# Only set the 'errors_occurred' flag for errors that may make
|
# Only set the 'errors_occurred' flag for errors that may make
|
||||||
# the connection unusable.
|
# the connection unusable.
|
||||||
if dj_exc_type not in (DataError, IntegrityError):
|
if dj_exc_type not in (DataError, IntegrityError):
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import sys
|
|
||||||
import threading
|
import threading
|
||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
|
@ -200,8 +199,7 @@ class Signal:
|
||||||
|
|
||||||
If any receiver raises an error (specifically any subclass of
|
If any receiver raises an error (specifically any subclass of
|
||||||
Exception), the error instance is returned as the result for that
|
Exception), the error instance is returned as the result for that
|
||||||
receiver. The traceback is always attached to the error at
|
receiver.
|
||||||
``__traceback__``.
|
|
||||||
"""
|
"""
|
||||||
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
|
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
|
||||||
return []
|
return []
|
||||||
|
@ -213,8 +211,6 @@ class Signal:
|
||||||
try:
|
try:
|
||||||
response = receiver(signal=self, sender=sender, **named)
|
response = receiver(signal=self, sender=sender, **named)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if not hasattr(err, '__traceback__'):
|
|
||||||
err.__traceback__ = sys.exc_info()[2]
|
|
||||||
responses.append((receiver, err))
|
responses.append((receiver, err))
|
||||||
else:
|
else:
|
||||||
responses.append((receiver, response))
|
responses.append((receiver, response))
|
||||||
|
|
Loading…
Reference in New Issue