mirror of
https://github.com/django/django.git
synced 2025-01-09 18:06:34 +00:00
Fixed #36057 -- Enabled test runner to debug chained exceptions with --pdb
on Python 3.13+.
This commit is contained in:
parent
ec0e784f91
commit
51df0dff3c
@ -30,7 +30,7 @@ from django.test.utils import setup_test_environment
|
||||
from django.test.utils import teardown_databases as _teardown_databases
|
||||
from django.test.utils import teardown_test_environment
|
||||
from django.utils.datastructures import OrderedSet
|
||||
from django.utils.version import PY312
|
||||
from django.utils.version import PY312, PY313
|
||||
|
||||
try:
|
||||
import ipdb as pdb
|
||||
@ -126,7 +126,10 @@ class PDBDebugResult(unittest.TextTestResult):
|
||||
self.buffer = False
|
||||
exc_type, exc_value, traceback = error
|
||||
print("\nOpening PDB: %r" % exc_value)
|
||||
pdb.post_mortem(traceback)
|
||||
if PY313:
|
||||
pdb.post_mortem(exc_value)
|
||||
else:
|
||||
pdb.post_mortem(traceback)
|
||||
|
||||
|
||||
class DummyList:
|
||||
|
Loading…
Reference in New Issue
Block a user