Skip to content

Commit 8595297

Browse files
committed
[ModelicaSystem] split __init__() - mypy fix in ModelicaSystemCmd
1 parent af45662 commit 8595297

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

OMPython/ModelicaSystem.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ def __getitem__(self, index: int):
112112
class ModelicaSystemCmd:
113113
"""A compiled model executable."""
114114

115-
def __init__(self, runpath: OMCPath, modelname: str, timeout: Optional[float] = None) -> None:
115+
def __init__(
116+
self,
117+
runpath: OMCPath,
118+
modelname: Optional[str] = None,
119+
timeout: Optional[float] = None,
120+
) -> None:
121+
if modelname is None:
122+
raise ModelicaSystemError("Missing model name!")
123+
116124
self._runpath = runpath
117125
self._model_name = modelname
118126
self._timeout = timeout

0 commit comments

Comments
 (0)