Skip to content

Commit a422dd7

Browse files
authored
fix(profiler): Accessing __mro__ might throw a ValueError (#2952)
1 parent 11e1f9a commit a422dd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/profiler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def get_frame_name(frame):
347347
for cls in frame.f_locals["self"].__class__.__mro__:
348348
if name in cls.__dict__:
349349
return "{}.{}".format(cls.__name__, name)
350-
except AttributeError:
350+
except (AttributeError, ValueError):
351351
pass
352352

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

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

0 commit comments

Comments
 (0)