Add comment about error assigning in frame.report_usage (#148105)

This commit is contained in:
Erik Montnemery 2025-07-04 14:47:01 +02:00 committed by GitHub
parent 4be2e84ce6
commit 99d63c49bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,6 +193,11 @@ def report_usage(
exclude_integrations=exclude_integrations
)
except MissingIntegrationFrame as err:
# We need to be careful with assigning the error here as it affects the
# cleanup of objects referenced from the stack trace as seen in
# https://github.com/home-assistant/core/pull/148021#discussion_r2182379834
# When core_behavior is ReportBehavior.ERROR, we will re-raise the error,
# so we can safely assign it to integration_frame_err.
if core_behavior is ReportBehavior.ERROR:
integration_frame_err = err
_report_usage_partial = functools.partial(