Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r84273:2b6f54d085d2
Date: 2016-05-06 17:53 -0700
http://bitbucket.org/pypy/pypy/changeset/2b6f54d085d2/
Log: __qualname__ must be removed from the type dict so it doesn't
propagate down to the instance
diff --git a/pypy/objspace/std/test/test_dictproxy.py
b/pypy/objspace/std/test/test_dictproxy.py
--- a/pypy/objspace/std/test/test_dictproxy.py
+++ b/pypy/objspace/std/test/test_dictproxy.py
@@ -57,8 +57,6 @@
assert a.__dict__ != b.__dict__
assert a.__dict__ != {'123': '456'}
assert {'123': '456'} != a.__dict__
- b.__dict__.pop('__qualname__')
- c.__dict__.pop('__qualname__')
assert b.__dict__ == c.__dict__
def test_str_repr(self):
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -1103,8 +1103,9 @@
layout = create_all_slots(w_self, hasoldstylebase, w_bestbase,
force_new_layout)
- if '__qualname__' in w_self.dict_w:
- w_self.qualname = w_self.space.unicode_w(w_self.dict_w['__qualname__'])
+ w_qualname = w_self.dict_w.pop('__qualname__', None)
+ if w_qualname is not None:
+ w_self.qualname = w_self.space.unicode_w(w_qualname)
ensure_common_attributes(w_self)
return layout
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit