From 84cad71cf5abe8eedbee330ec45af353018fbdba Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 15 Dec 2013 19:30:20 +0000 Subject: [PATCH] Fix inspection of the stack if the 'self' object has no __dict__. --- src/utils/python.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/python.py b/src/utils/python.py index e578b21d1..6ec4ae079 100644 --- a/src/utils/python.py +++ b/src/utils/python.py @@ -142,8 +142,9 @@ def collect_extra_debug_data(): frame_locals = frame.f_locals for inspected in ('self', 'cls'): if inspected in frame_locals: - for (key, value) in frame_locals[inspected].__dict__.items(): - frame_locals['%s.%s' % (inspected, key)] = value + if frame_locals[inspected].__dict__: + for (key, value) in frame_locals[inspected].__dict__.items(): + frame_locals['%s.%s' % (inspected, key)] = value for key, value in frame_locals.items(): if key == '__builtins__': # This is flooding