diff --git a/bindings/py3devil1geo.py b/bindings/py3devil1geo.py index 4102565..fabf65d 100644 --- a/bindings/py3devil1geo.py +++ b/bindings/py3devil1geo.py @@ -145,7 +145,8 @@ class pyGeoHeader: self.cstruct = ctypes.pointer(Header()) ptrofptr = ctypes.byref(self.cstruct) if filedata: - devil1geo.getheader(ptrofptr, filedata) + if not devil1geo.getheader(ptrofptr, filedata): + raise RuntimeError("failed to get geometry file header") return def show(self): @@ -175,7 +176,8 @@ class pyMeshHeader: self.cstruct = ctypes.pointer(MeshHeader()) ptrofptr = ctypes.byref(self.cstruct) if filedata: - devil1geo.getmeshheader(ptrofptr, i, filedata) + if not devil1geo.getmeshheader(ptrofptr, i, filedata): + raise RuntimeError("failed to get mesh header #" + str(i)) return pass