Skip to content

Commit

Permalink
Revert "Python 3.11: Enhanced error locations in tracebacks (#2771)" (#…
Browse files Browse the repository at this point in the history
…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/python-dev@python.org/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.
  • Loading branch information
musicinmybrain authored Jul 25, 2022
1 parent 2ad9515 commit 05b27be
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions opentelemetry-sdk/tests/trace/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# pylint: disable=too-many-lines
import shutil
import subprocess
import sys
import unittest
from importlib import reload
from logging import ERROR, WARNING
Expand Down Expand Up @@ -1187,13 +1186,6 @@ def test_record_exception_context_manager(self):
stacktrace = """in test_record_exception_context_manager
raise RuntimeError("example error")
RuntimeError: example error"""
if sys.version_info >= (3, 11):
# https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks
tracelines = stacktrace.splitlines()
tracelines.insert(
-1, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
)
stacktrace = "\n".join(tracelines)
self.assertIn(stacktrace, event.attributes["exception.stacktrace"])

try:
Expand Down

0 comments on commit 05b27be

Please sign in to comment.