Browse Source

Merge branch 'release/1.10.x'

rdb 3 months ago
parent
commit
d8e9afb3f8

+ 1 - 1
panda/src/event/pythonTask.cxx

@@ -364,7 +364,7 @@ __getattribute__(PyObject *self, PyObject *attr) const {
   // We consult the instance dict first, since the user may have overridden a
   // We consult the instance dict first, since the user may have overridden a
   // method or something.
   // method or something.
   PyObject *item;
   PyObject *item;
-  if (PyDict_GetItemRef(__dict__, attr, &item) > 0) {
+  if (PyDict_GetItemRef(__dict__, attr, &item) != 0) {
     return item;
     return item;
   }
   }
 
 

+ 2 - 3
panda/src/pgraph/nodePath_ext.cxx

@@ -56,10 +56,9 @@ PyObject *Extension<NodePath>::
 __deepcopy__(PyObject *self, PyObject *memo) const {
 __deepcopy__(PyObject *self, PyObject *memo) const {
   extern struct Dtool_PyTypedObject Dtool_NodePath;
   extern struct Dtool_PyTypedObject Dtool_NodePath;
 
 
-  // Borrowed reference.
   PyObject *dupe;
   PyObject *dupe;
-  if (PyDict_GetItemRef(memo, self, &dupe) > 0) {
-    // Already in the memo dictionary.
+  if (PyDict_GetItemRef(memo, self, &dupe) != 0) {
+    // Already in the memo dictionary (or an error happened).
     return dupe;
     return dupe;
   }
   }
 
 

+ 2 - 3
panda/src/pgraph/pandaNode_ext.cxx

@@ -46,10 +46,9 @@ PyObject *Extension<PandaNode>::
 __deepcopy__(PyObject *self, PyObject *memo) const {
 __deepcopy__(PyObject *self, PyObject *memo) const {
   extern struct Dtool_PyTypedObject Dtool_PandaNode;
   extern struct Dtool_PyTypedObject Dtool_PandaNode;
 
 
-  // Borrowed reference.
   PyObject *dupe;
   PyObject *dupe;
-  if (PyDict_GetItemRef(memo, self, &dupe) > 0) {
-    // Already in the memo dictionary.
+  if (PyDict_GetItemRef(memo, self, &dupe) != 0) {
+    // Already in the memo dictionary (or an error happened).
     return dupe;
     return dupe;
   }
   }