Commit 415b8ed4 authored by Marius Wachtler's avatar Marius Wachtler

Fix crash when calling copy.deepcopy()

parent 8364a607
......@@ -1637,6 +1637,13 @@ static PyObject* reduce_2(PyObject* obj) noexcept {
PyErr_Clear();
state = Py_None;
Py_INCREF(state);
} else {
// Pyston change: convert attrwrapper to a real dict
if (state->cls == attrwrapper_cls) {
PyObject* real_dict = PyDict_New();
PyDict_Update(real_dict, state);
state = real_dict;
}
}
names = slotnames(cls);
if (names == NULL)
......
import copy
class C(object):
pass
c = C()
c.a = 1
c.b = (["str", 1], 2L)
print c.__dict__.items()
cc = copy.deepcopy(c)
del c.a
print cc.__dict__.items()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment