Skip to content

Commit da57d52

Browse files
committed
revert BaseException change
Signed-off-by: emdneto <[email protected]>
1 parent 534cd38 commit da57d52

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

opentelemetry-api/src/opentelemetry/trace/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def use_span(
588588
finally:
589589
context_api.detach(token)
590590

591-
except BaseException as exc: # pylint: disable=broad-exception-caught
591+
except Exception as exc: # pylint: disable=broad-exception-caught
592592
if isinstance(span, Span) and span.is_recording():
593593
# Record the exception as an event
594594
if record_exception:

opentelemetry-api/tests/trace/test_globals.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,6 @@ class TestUseSpanException(Exception):
133133

134134
self.assertEqual(test_span.recorded_exception, exception)
135135

136-
def test_use_span_base_exception(self):
137-
class TestUseSpanBaseException(BaseException):
138-
pass
139-
140-
test_span = SpanTest(trace.INVALID_SPAN_CONTEXT)
141-
exception = TestUseSpanBaseException("test exception")
142-
with self.assertRaises(TestUseSpanBaseException):
143-
with trace.use_span(test_span):
144-
raise exception
145-
146-
self.assertEqual(test_span.recorded_exception, exception)
147-
148136
def test_use_span_set_status(self):
149137
class TestUseSpanException(Exception):
150138
pass

0 commit comments

Comments
 (0)