diff --git a/oslo_service/eventlet_backdoor.py b/oslo_service/eventlet_backdoor.py index 83908055..ada9a938 100644 --- a/oslo_service/eventlet_backdoor.py +++ b/oslo_service/eventlet_backdoor.py @@ -86,7 +86,8 @@ def _detailed_dump_frames(f, thread_index): def _find_objects(t): - return [o for o in gc.get_objects() if isinstance(o, t)] + return [o for o in gc.get_objects() + if hasattr(o, "__class__") and isinstance(o, t)] def _capture_profile(fname=''): diff --git a/releasenotes/notes/fix-find-object-in-backdoor-487bf78c4c502594.yaml b/releasenotes/notes/fix-find-object-in-backdoor-487bf78c4c502594.yaml new file mode 100644 index 00000000..31c088ad --- /dev/null +++ b/releasenotes/notes/fix-find-object-in-backdoor-487bf78c4c502594.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix the backdoor helper method fo() to also work when there are objects + present in the current python instance that do not have a __class__ + attribute.