Skip to content

Commit 4d0a4bc

Browse files
committed
[ModelicaSystem] do not use package csv
background: if OMCPath will be used, it is not available
1 parent 3e9c55b commit 4d0a4bc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
CONDITIONS OF OSMC-PL.
3333
"""
3434

35-
import csv
3635
from dataclasses import dataclass
3736
import importlib
3837
import logging
@@ -1324,9 +1323,10 @@ def _createCSVData(self, csvfile: Optional[pathlib.Path] = None) -> pathlib.Path
13241323
if csvfile is None:
13251324
csvfile = self._tempdir / f'{self._model_name}.csv'
13261325

1327-
with open(file=csvfile, mode="w", encoding="utf-8", newline="") as fh:
1328-
writer = csv.writer(fh)
1329-
writer.writerows(csv_rows)
1326+
# basic definition of a CSV file using csv_rows as input
1327+
csv_content = "\n".join([",".join(map(str, row)) for row in csv_rows]) + "\n"
1328+
1329+
csvfile.write_text(csv_content)
13301330

13311331
return csvfile
13321332

0 commit comments

Comments
 (0)