Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r89030:cbf1cf403292
Date: 2016-12-12 17:09 +0000
http://bitbucket.org/pypy/pypy/changeset/cbf1cf403292/
Log: hg merge default
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -464,9 +464,9 @@
new_layout = (pto.c_tp_basicsize > minsize or pto.c_tp_itemsize > 0)
W_TypeObject.__init__(self, space, name,
- bases_w or [space.w_object], dict_w, force_new_layout=new_layout)
+ bases_w or [space.w_object], dict_w, force_new_layout=new_layout,
+ is_heaptype=flag_heaptype)
self.flag_cpytype = True
- self.flag_heaptype = flag_heaptype
# if a sequence or a mapping, then set the flag to force it
if pto.c_tp_as_sequence and pto.c_tp_as_sequence.c_sq_item:
self.flag_map_or_seq = 'S'
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
@@ -163,7 +163,8 @@
@dont_look_inside
def __init__(self, space, name, bases_w, dict_w,
- overridetypedef=None, force_new_layout=False):
+ overridetypedef=None, force_new_layout=False,
+ is_heaptype=True):
self.space = space
self.name = name
self.qualname = None
@@ -174,7 +175,7 @@
self.weakrefable = False
self.w_doc = space.w_None
self.weak_subclasses = []
- self.flag_heaptype = False
+ self.flag_heaptype = is_heaptype
self.flag_cpytype = False
self.flag_abstract = False
self.flag_sequence_bug_compat = False
@@ -727,7 +728,7 @@
dict_w[key] = space.getitem(w_dict, w_key)
w_type = space.allocate_instance(W_TypeObject, w_typetype)
W_TypeObject.__init__(w_type, space, name, bases_w or [space.w_object],
- dict_w)
+ dict_w, is_heaptype=True)
w_type.ready()
return w_type
@@ -1173,7 +1174,6 @@
if len(w_self.bases_w) == 0:
w_self.bases_w = [w_self.space.w_object]
w_bestbase = check_and_find_best_base(w_self.space, w_self.bases_w)
- w_self.flag_heaptype = True
for w_base in w_self.bases_w:
if not isinstance(w_base, W_TypeObject):
continue
@@ -1194,7 +1194,6 @@
w_self.weakrefable = instancetypedef.weakrefable
w_self.w_doc = w_self.space.wrap(instancetypedef.doc)
ensure_common_attributes(w_self)
- w_self.flag_heaptype = instancetypedef.heaptype
#
# usually 'instancetypedef' is new, i.e. not seen in any base,
# but not always (see Exception class)
@@ -1376,7 +1375,8 @@
else:
overridetypedef = typedef
w_type = W_TypeObject(space, typedef.name, bases_w, dict_w,
- overridetypedef=overridetypedef)
+ overridetypedef=overridetypedef,
+ is_heaptype=overridetypedef.heaptype)
if typedef is not overridetypedef:
w_type.w_doc = space.wrap(typedef.doc)
else:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit