Skip to content

Commit c16263a

Browse files
authored
Fix issue 43442 (#44053)
* Fixes issues 43442 - SyntaxWarning: 'return' in a 'finally' block in azure-monitor-opentelemetry-exporter with Python 3.14 * Add CHANGELOG * Update CHANGELOG * Updated link in CHANGELOG
1 parent b2a3034 commit c16263a

File tree

2 files changed

+7
-4
lines changed
  • sdk/monitor/azure-monitor-opentelemetry-exporter

2 files changed

+7
-4
lines changed

sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
### Breaking Changes
88

99
### Bugs Fixed
10+
- Fixes issue #43442: SyntaxWarning: 'return' in a 'finally' block in azure-monitor-opentelemetry-exporter with Python 3.14
11+
([#44053](https://github.com/Azure/azure-sdk-for-python/pull/44053))
1012

1113
### Other Changes
1214

sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def _transmit(self, envelopes: List[TelemetryItem]) -> ExportResult:
267267
# Currently only used for statsbeat exporter to detect shutdown cases
268268
reach_ingestion = False
269269
start_time = time.time()
270+
final_result = None
270271
try:
271272
track_response = self.client.track(envelopes)
272273
if not track_response.errors: # 200
@@ -467,11 +468,11 @@ def _transmit(self, envelopes: List[TelemetryItem]) -> ExportResult:
467468
)
468469

469470
shutdown_statsbeat_metrics()
471+
final_result = ExportResult.FAILED_NOT_RETRYABLE
470472

471-
# pylint: disable=lost-exception
472-
return ExportResult.FAILED_NOT_RETRYABLE # pylint: disable=W0134
473-
# pylint: disable=lost-exception
474-
return result # pylint: disable=W0134
473+
if final_result is None:
474+
final_result = result
475+
return final_result
475476

476477
# No spans to export
477478
self._consecutive_redirects = 0

0 commit comments

Comments
 (0)