Skip to content

Commit

Permalink
Use isinstance instead of type
Browse files Browse the repository at this point in the history
Co-authored-by: Ivana Kellyerova <ivana.kellyerova@sentry.io>
  • Loading branch information
davidcroda and sentrivana committed Nov 30, 2023
1 parent 5d30d73 commit 2792d17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs):
headers = request_data.get("headers", {})

Check warning on line 140 in sentry_sdk/integrations/aws_lambda.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/integrations/aws_lambda.py#L140

Added line #L140 was not covered by tests
# Some AWS Services (ie. EventBridge) set headers as a list
# or None, so we must ensure it is a dict
if type(headers) is not dict:
if not isinstance(headers, dict):
headers = {}

transaction = continue_trace(
Expand Down

0 comments on commit 2792d17

Please sign in to comment.