From 85c04eac52abe3aa0c54cd079bf87e64a60b62bd Mon Sep 17 00:00:00 2001 From: kat Date: Thu, 25 Jul 2024 21:34:55 -0400 Subject: Properly check for/log failures and return status on Typelib.write_to_file --- python/typelibrary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/typelibrary.py') diff --git a/python/typelibrary.py b/python/typelibrary.py index c9ddd37b..724f8c5e 100644 --- a/python/typelibrary.py +++ b/python/typelibrary.py @@ -87,8 +87,10 @@ class TypeLibrary: :param str path: :rtype: None + :raises: OSError if saving the file fails """ - core.BNWriteTypeLibraryToFile(self.handle, path) + if not core.BNWriteTypeLibraryToFile(self.handle, path): + raise OSError(f"Failed to write type library to '{path}'") @staticmethod def from_name(arch: architecture.Architecture, name: str): -- cgit v1.3.1