Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(profiler): Accessing __class__ might throw a ValueError #2952

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions sentry_sdk/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def get_frame_name(frame):
for cls in frame.f_locals["self"].__class__.__mro__:
if name in cls.__dict__:
return "{}.{}".format(cls.__name__, name)
except AttributeError:
except (AttributeError, ValueError):
pass

# if it was a class method, (decorated with `@classmethod`)
Expand All @@ -363,7 +363,7 @@ def get_frame_name(frame):
for cls in frame.f_locals["cls"].__mro__:
if name in cls.__dict__:
return "{}.{}".format(cls.__name__, name)
except AttributeError:
except (AttributeError, ValueError):
pass

# nothing we can do if it is a staticmethod (decorated with @staticmethod)
Expand Down