diff options
| author | kat <kat@vector35.com> | 2024-07-25 21:34:55 -0400 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2024-07-26 01:36:37 -0400 |
| commit | 85c04eac52abe3aa0c54cd079bf87e64a60b62bd (patch) | |
| tree | a19146f692a4ebd206b51a0343d903e48d9c3cc9 /python/typelibrary.py | |
| parent | 326cb30bfa0d8a4bc2e37d56b20b95624e85f3d8 (diff) | |
Properly check for/log failures and return status on Typelib.write_to_file
Diffstat (limited to 'python/typelibrary.py')
| -rw-r--r-- | python/typelibrary.py | 4 |
1 files changed, 3 insertions, 1 deletions
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): |
