Skip to content

Commit 6a4f7f4

Browse files
authored
Merge branch 'master' into dependabot/pip/sample-apps/flask/requests-2.32.0
2 parents 4f4349b + 1ea7768 commit 6a4f7f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

aws_xray_sdk/core/context.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ def end_subsegment(self, end_time=None):
7878
:param float end_time: epoch in seconds. If not specified the current
7979
system time will be used.
8080
"""
81-
subsegment = self.get_trace_entity()
82-
if self._is_subsegment(subsegment):
83-
subsegment.close(end_time)
81+
entity = self.get_trace_entity()
82+
if self._is_subsegment(entity):
83+
entity.close(end_time)
8484
self._local.entities.pop()
8585
return True
86+
elif isinstance(entity, DummySegment):
87+
return False
8688
else:
8789
log.warning("No subsegment to end.")
8890
return False

0 commit comments

Comments
 (0)