django1/django/db
Raphaël Hertzog 9f4e031bd3 Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions.
When Django reraises an exception, it sets the __cause__ attribute even
in Python 2, mimicking Python's 3 behavior for "raise Foo from Bar".
However, Python 3 also ensures that all exceptions have a __traceback__
attribute and thus the "traceback2" Python 2 module (backport of Python
3's "traceback" module) relies on the fact that whenever you have a
__cause__ attribute, the recorded exception also has a __traceback__
attribute.

This is breaking testtools which is using traceback2 (see
https://github.com/testing-cabal/testtools/issues/162).

This commit fixes this inconsistency by ensuring that Django sets
the __traceback__ attribute on any exception stored in a __cause__
attribute of a reraised exception.
2015-12-03 16:31:50 -05:00
..
backends Fixed #25767 -- Fixed data truncation possibility with Positive(Small)IntegerField on MySQL. 2015-11-24 11:09:15 -05:00
migrations Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions. 2015-12-03 16:31:50 -05:00
models Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
__init__.py Sorted imports in __init__.py files. 2015-06-27 11:53:33 -04:00
transaction.py Fixed #24921 -- set_autocommit(False) + ORM queries. 2015-09-21 22:21:53 +02:00
utils.py Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions. 2015-12-03 16:31:50 -05:00