Przeglądaj źródła

don't hide errors in __len__

Darren Ranalli 18 lat temu
rodzic
commit
83b5b73359
1 zmienionych plików z 1 dodań i 5 usunięć
  1. 1 5
      direct/src/showbase/ContainerLeakDetector.py

+ 1 - 5
direct/src/showbase/ContainerLeakDetector.py

@@ -334,11 +334,7 @@ class FindContainers(Job):
         return False
         return False
 
 
     def _hasLength(self, obj):
     def _hasLength(self, obj):
-        try:
-            len(obj)
-        except:
-            return False
-        return True
+        return hasattr(obj, '__len__')
 
 
     def _addContainerGen(self, cont, objRef):
     def _addContainerGen(self, cont, objRef):
         contId = id(cont)
         contId = id(cont)