mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
Fix exception when trying to pickle NodePathCollection objects
This commit is contained in:
parent
c822fb57af
commit
4526de8f7a
@ -45,6 +45,7 @@ This issue fixes several bugs that were still found in 1.9.2.
|
|||||||
* Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons
|
* Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons
|
||||||
* Add keyword argument support to make() methods such as Shader.make()
|
* Add keyword argument support to make() methods such as Shader.make()
|
||||||
* Fix compilation errors with Bullet 2.84
|
* Fix compilation errors with Bullet 2.84
|
||||||
|
* Fix exception when trying to pickle NodePathCollection objects
|
||||||
|
|
||||||
------------------------ RELEASE 1.9.2 ------------------------
|
------------------------ RELEASE 1.9.2 ------------------------
|
||||||
|
|
||||||
|
@ -84,16 +84,19 @@ __reduce__(PyObject *self) const {
|
|||||||
// (e.g. this), and the arguments necessary to reconstruct this
|
// (e.g. this), and the arguments necessary to reconstruct this
|
||||||
// object.
|
// object.
|
||||||
|
|
||||||
PyObject *this_class = PyObject_Type(self);
|
PyObject *this_class = (PyObject *)self->ob_type;
|
||||||
if (this_class == NULL) {
|
if (this_class == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject *self_iter = PyObject_GetIter(self);
|
||||||
|
if (self_iter == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Since a NodePathCollection is itself an iterator, we can simply
|
// Since a NodePathCollection is itself an iterator, we can simply
|
||||||
// pass it as the fourth tuple component.
|
// pass it as the fourth tuple component.
|
||||||
PyObject *result = Py_BuildValue("(O()OO)", this_class, Py_None, self);
|
return Py_BuildValue("(O()ON)", this_class, Py_None, self_iter);
|
||||||
Py_DECREF(this_class);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user