Skip to content

Commit

Permalink
fix(profiler): Accessing __mro__ might throw a ValueError (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Apr 10, 2024
1 parent 11e1f9a commit a422dd7
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit a422dd7

Please sign in to comment.