django1/django
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
..
apps Refs #24215 -- Fixed Python 3.5 compatiblity for unhandled lazy ops error. 2015-09-17 10:06:52 -04:00
bin Removed bin/unique-messages.py 2015-02-06 08:47:38 -05:00
conf Pulled core Django translations from Transifex 2015-12-01 20:36:53 +01:00
contrib Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
core Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
db Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions. 2015-12-03 16:31:50 -05:00
dispatch Moved and updated Python license. 2015-09-28 09:53:37 -04:00
forms Fixed #25683 -- Allowed ModelChoiceField(queryset=...) to accept Managers. 2015-11-09 12:42:36 -05:00
http Fixed #25644 -- Fixed reset cookie expiry date bug. 2015-11-18 07:47:40 -05:00
middleware Fixed #25302 (again) -- Ignored scheme when checking for bad referers. 2015-11-26 21:27:12 +01:00
template Fixed #25825 -- Implemented __ne__() for template Origin 2015-12-03 15:59:34 -05:00
templatetags Refs #22306 -- Removed cycle/firstof template tags from "future". 2015-09-23 19:31:09 -04:00
test Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
utils Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions. 2015-12-03 16:31:50 -05:00
views Removed blank line to appease isort. 2015-11-17 19:01:06 -05:00
__init__.py Fixed #16734 -- Set script prefix even outside of requests 2015-10-29 20:12:38 +01:00
__main__.py Fixed #24857 -- Added "python -m django" entry point. 2015-09-07 19:54:32 -04:00
shortcuts.py Removed dictionary and context_instance parameters for render functions. 2015-09-23 19:31:11 -04:00