Skip to content

Commit 05b27be

Browse files
Revert "Python 3.11: Enhanced error locations in tracebacks (#2771)" (#2839)
This reverts commit aa36730. It is no longer required on Python 3.11.0b4 and later; see #2771 (comment) and https://mail.python.org/archives/list/[email protected]/message/73YP4RS4QOJXUS63BQZVLTQHK3OP3L3H/. Specifically, the ^^^^… are now omitted when they would “underline” the whole preceding line, which is the case here, so the expected output is the same as for Python 3.10 and earlier.
1 parent 2ad9515 commit 05b27be

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

opentelemetry-sdk/tests/trace/test_trace.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# pylint: disable=too-many-lines
1616
import shutil
1717
import subprocess
18-
import sys
1918
import unittest
2019
from importlib import reload
2120
from logging import ERROR, WARNING
@@ -1187,13 +1186,6 @@ def test_record_exception_context_manager(self):
11871186
stacktrace = """in test_record_exception_context_manager
11881187
raise RuntimeError("example error")
11891188
RuntimeError: example error"""
1190-
if sys.version_info >= (3, 11):
1191-
# https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks
1192-
tracelines = stacktrace.splitlines()
1193-
tracelines.insert(
1194-
-1, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
1195-
)
1196-
stacktrace = "\n".join(tracelines)
11971189
self.assertIn(stacktrace, event.attributes["exception.stacktrace"])
11981190

11991191
try:

0 commit comments

Comments
 (0)