diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-01-06 11:27:59 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2021-01-10 10:14:16 +0100 |
commit | 0de91f9313a4c76445ada1617fff69d97fe12217 (patch) | |
tree | 1e5074682a4996db4d54ac9b6c92e8745f05d753 /pyGHDL/lsp/workspace.py | |
parent | 015adfc69e63e46c7823524032636faa99106c1f (diff) | |
download | ghdl-0de91f9313a4c76445ada1617fff69d97fe12217.tar.gz ghdl-0de91f9313a4c76445ada1617fff69d97fe12217.tar.bz2 ghdl-0de91f9313a4c76445ada1617fff69d97fe12217.zip |
Make API more pythonic be replacing C-like byte arrays with str. Abstracted utf-8 encoding/decoding.
Diffstat (limited to 'pyGHDL/lsp/workspace.py')
-rw-r--r-- | pyGHDL/lsp/workspace.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pyGHDL/lsp/workspace.py b/pyGHDL/lsp/workspace.py index 8c60edab9..980289806 100644 --- a/pyGHDL/lsp/workspace.py +++ b/pyGHDL/lsp/workspace.py @@ -194,7 +194,7 @@ class Workspace(object): return log.info("Using options: %s", ghdl_opts) for opt in ghdl_opts: - if not libghdl.set_option(opt.encode("utf-8")): + if not libghdl.set_option(opt): self._server.show_message( lsp.MessageType.Error, "error with option: {}".format(opt) ) @@ -234,7 +234,7 @@ class Workspace(object): diag = {} for i in range(nbr_msgs): hdr = errorout_memory.Get_Error_Record(i + 1) - msg = errorout_memory.Get_Error_Message(i + 1).decode("utf-8") + msg = errorout_memory.Get_Error_Message(i + 1) if hdr.file == 0: # Possible for error limit reached. continue @@ -452,12 +452,12 @@ class Workspace(object): return res # Find library - lib_id = name_table.Get_Identifier(library.encode("utf-8")) + lib_id = name_table.Get_Identifier(library) lib = libraries.Get_Library_No_Create(lib_id) if lib == name_table.Null_Identifier: return None # Find entity - ent_id = name_table.Get_Identifier(name.encode("utf-8")) + ent_id = name_table.Get_Identifier(name) unit = libraries.Find_Primary_Unit(lib, ent_id) if unit == nodes.Null_Iir: return None |