aboutsummaryrefslogtreecommitdiffstats
path: root/python/libghdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-12-26 14:26:59 +0100
committerTristan Gingold <tgingold@free.fr>2020-12-26 17:35:10 +0100
commitb9788c0bb2fabdcdd70029cd2ffbdd12706aea1d (patch)
treeeb903a286fca01f9c039f6c69a92e1399a90c84e /python/libghdl
parentf60887e70ac8f2b24637b4710f5cb9a18acef6aa (diff)
downloadghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.tar.gz
ghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.tar.bz2
ghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.zip
libraries: Load_Std_Library: now return a status.
Propagate this change to libghdl and python binding to avoid abort. For #1551
Diffstat (limited to 'python/libghdl')
-rw-r--r--python/libghdl/__init__.py7
1 files changed, 6 insertions, 1 deletions
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))