From cef4720e42d2b0d21cb3a35b51c0843f44789129 Mon Sep 17 00:00:00 2001 From: _ <_> Date: Thu, 17 May 2018 11:35:19 -0700 Subject: [PATCH] Added exceptions for pld getheader() --- bindings/py3devil1pld.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/py3devil1pld.py b/bindings/py3devil1pld.py index bb4d54c..62ed79b 100644 --- a/bindings/py3devil1pld.py +++ b/bindings/py3devil1pld.py @@ -38,7 +38,8 @@ class pyPldHeader: # Store C Struct in order to call C functions self.cstruct = PldHeader() if filedata: - devil1pld.getheader(ctypes.byref(self.cstruct), filedata) + if not devil1pld.getheader(ctypes.byref(self.cstruct), filedata): + raise RuntimeError("failed to get .pld header") self.eof = len(filedata) def show(self):