60 |
60 |
|
61 |
61 |
def _cpyext_attach_pyobj(self, space, py_obj): |
62 |
62 |
self._cpy_ref = py_obj |
63 |
|
rawrefcount.create_link_pyobj(self, py_obj) |
|
63 |
if type(self) is cls: |
|
64 |
rawrefcount.create_link_pyobj(self, py_obj) |
|
65 |
else: |
|
66 |
# optimization of create_link_pyobj() doesn't work for |
|
67 |
# interp-level subclasses! |
|
68 |
rawrefcount.create_link_pypy(self, py_obj) |
64 |
69 |
cls._cpyext_attach_pyobj = _cpyext_attach_pyobj |
65 |
70 |
|
66 |
71 |
add_direct_pyobj_storage(W_BaseCPyObject) |
… |
128 |
133 |
w_type) |
129 |
134 |
raise |
130 |
135 |
track_reference(space, obj, w_obj) |
131 |
|
if w_type.flag_cpytype: |
132 |
|
assert isinstance(w_obj, W_BaseCPyObject) |
133 |
|
w_obj._cpy_ref = obj |
134 |
136 |
return w_obj |
135 |
137 |
|
136 |
138 |
typedescr_cache = {} |