Browse Source

Fix unit test failures on Python 3.13

rdb 1 year ago
parent
commit
e43dc87df5
2 changed files with 4 additions and 3 deletions
  1. 1 1
      panda/src/collide/collisionNode_ext.cxx
  2. 3 2
      tests/showbase/test_Loader.py

+ 1 - 1
panda/src/collide/collisionNode_ext.cxx

@@ -29,7 +29,7 @@ get_owner() const {
   PyObject *strong_ref;
   PyObject *strong_ref;
   int result = 0;
   int result = 0;
   if (owner != nullptr) {
   if (owner != nullptr) {
-    PyWeakref_GetRef(owner, &strong_ref);
+    result = PyWeakref_GetRef(owner, &strong_ref);
   }
   }
   if (result > 0) {
   if (result > 0) {
     return strong_ref;
     return strong_ref;

+ 3 - 2
tests/showbase/test_Loader.py

@@ -120,9 +120,10 @@ fnrgl = fnargle:FnargleLoader
         sys.path = [str(tmp_path), platstdlib, stdlib]
         sys.path = [str(tmp_path), platstdlib, stdlib]
 
 
         Loader._loadedPythonFileTypes = False
         Loader._loadedPythonFileTypes = False
+        loader = Loader()
 
 
-        # base parameter is only used for audio
-        loader = Loader(None)
+        if not Loader._loadedPythonFileTypes:
+            Loader._loadPythonFileTypes()
         assert Loader._loadedPythonFileTypes
         assert Loader._loadedPythonFileTypes
 
 
         # Should be registered, not yet loaded
         # Should be registered, not yet loaded