From b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 26 Dec 2020 14:26:59 +0100 Subject: libraries: Load_Std_Library: now return a status. Propagate this change to libghdl and python binding to avoid abort. For #1551 --- python/libghdl/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python/libghdl') diff --git a/python/libghdl/__init__.py b/python/libghdl/__init__.py index 08c0e202c..4ba7b6b26 100644 --- a/python/libghdl/__init__.py +++ b/python/libghdl/__init__.py @@ -72,6 +72,7 @@ def _get_libghdl_path(): # Load the shared library _libghdl_path = _get_libghdl_path() +# print("Load {}".format(_libghdl_path)) libghdl = ctypes.CDLL(_libghdl_path) # Initialize it. @@ -90,8 +91,12 @@ def set_option(opt): def analyze_init(): - return libghdl.libghdl__analyze_init() + # Deprecated as it may raise an exception. Use analyze_init_status + libghdl.libghdl__analyze_init() +def analyze_init_status(): + # Return 0 in case of success + return libghdl.libghdl__analyze_init_status() def analyze_file(fname): return libghdl.libghdl__analyze_file(*_to_char_p(fname)) -- cgit v1.2.3