From: Ethan Furman Date: Fri, 18 Oct 2013 08:22:08 +0000 (-0700) Subject: Issue #19030: special-cased __dict__ as the actual dict is not returned, a proxy is. X-Git-Tag: v3.4.0a4~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b0707d91358d23cb9453918477d1d0b1fccd82;p=thirdparty%2FPython%2Fcpython.git Issue #19030: special-cased __dict__ as the actual dict is not returned, a proxy is. --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 7cd70115c62d..2e3a670808e6 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -362,6 +362,8 @@ def classify_class_attrs(cls): dict_obj = sentinel if name not in processed: try: + if name == '__dict__': + raise Exception("__dict__ is special, we don't want the proxy") get_obj = getattr(cls, name) except Exception as exc: pass