From 4b574f94563f5cc873b4df494403ae1436d5c075 Mon Sep 17 00:00:00 2001 From: _ <_> Date: Thu, 17 May 2018 11:08:58 -0700 Subject: [PATCH] Added raise RuntimeError blocks for all pyobjects in geo --- bindings/py3devil1geo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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