aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/_decorator.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyGHDL/libghdl/_decorator.py')
-rw-r--r--pyGHDL/libghdl/_decorator.py28
1 files changed, 6 insertions, 22 deletions
diff --git a/pyGHDL/libghdl/_decorator.py b/pyGHDL/libghdl/_decorator.py
index 9c5aefa19..32a02930d 100644
--- a/pyGHDL/libghdl/_decorator.py
+++ b/pyGHDL/libghdl/_decorator.py
@@ -128,18 +128,12 @@ def BindToLibGHDL(subprogramName):
typeHintCount = len(typeHints)
if typeHintCount == 0:
- raise ValueError(
- "Function {0} is not annotated with types.".format(func.__name__)
- )
+ raise ValueError("Function {0} is not annotated with types.".format(func.__name__))
try:
returnType = typeHints["return"]
except KeyError:
- raise ValueError(
- "Function {0} is not annotated with a return type.".format(
- func.__name__
- )
- )
+ raise ValueError("Function {0} is not annotated with a return type.".format(func.__name__))
if (typeHintCount - 1) != func.__code__.co_argcount:
raise ValueError(
@@ -159,19 +153,13 @@ def BindToLibGHDL(subprogramName):
parameterTypes.append(PythonTypeToCtype(parameter))
except TypeError:
raise TypeError(
- "Unsupported parameter type '{0!s}' in function '{1}'.".format(
- parameter, func.__name__
- )
+ "Unsupported parameter type '{0!s}' in function '{1}'.".format(parameter, func.__name__)
)
try:
resultType = PythonTypeToCtype(returnType)
except TypeError:
- raise TypeError(
- "Unsupported return type '{0!s}' in function '{1}'.".format(
- returnType, func.__name__
- )
- )
+ raise TypeError("Unsupported return type '{0!s}' in function '{1}'.".format(returnType, func.__name__))
functionPointer = getattr(libghdl, subprogramName)
functionPointer.parameterTypes = parameterTypes
@@ -186,9 +174,7 @@ def BindToLibGHDL(subprogramName):
except OSError as ex:
errors = [str(ex)]
raise LibGHDLException(
- "Caught exception when calling '{func}' in libghdl.".format(
- func=subprogramName
- ),
+ "Caught exception when calling '{func}' in libghdl.".format(func=subprogramName),
errors,
) from ex
@@ -204,9 +190,7 @@ def BindToLibGHDL(subprogramName):
except OSError as ex:
errors = [str(ex)]
raise LibGHDLException(
- "Caught exception when calling '{func}' in libghdl.".format(
- func=subprogramName
- ),
+ "Caught exception when calling '{func}' in libghdl.".format(func=subprogramName),
errors,
) from ex