summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
diff options
context:
space:
mode:
authorAmmar Askar <ammar@ammaraskar.com>2021-07-04 23:14:33 (GMT)
committerGitHub <noreply@github.com>2021-07-04 23:14:33 (GMT)
commit5644c7b3ffd49bed58dc095be6e6148e0bb4431e (patch)
treec53063e2f78685d1f284f6e333e05f44e49ea5ca /Lib/test/test_zipimport.py
parent693cec0e2dcafa393ed5cdaa606f8dc8e3876adf (diff)
downloadcpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.zip
cpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.tar.gz
cpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.tar.bz2
bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location to print carets on the specific expressions involved in a traceback. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Diffstat (limited to 'Lib/test/test_zipimport.py')
-rw-r--r--Lib/test/test_zipimport.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index dfc4a06..861ebe3 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -716,7 +716,10 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
s = io.StringIO()
print_tb(tb, 1, s)
- self.assertTrue(s.getvalue().endswith(raise_src))
+ self.assertTrue(s.getvalue().endswith(
+ ' def do_raise(): raise TypeError\n'
+ ' ^^^^^^^^^^^^^^^\n'
+ ))
else:
raise AssertionError("This ought to be impossible")