Open gadieid opened 5 months ago
Error on import in Python3.9
----> 1 import pyofm
/raid/software/python/pyenv/jammy/env/lib/python3.9/site-packages/pyofm/init.py in 1 version = '1.2.2' 2 ----> 3 from .pyOFM import PYOFM
/raid/software/python/pyenv/jammy/env/lib/python3.9/site-packages/pyofm/pyOFM.py in 15 from mpi4py import MPI 16 import gzip ---> 17 from .pyOFMesh import pyOFMesh 18 19
pyOFMesh.pyx in init pyOFMesh()
NameError: name 'exit' is not defined
Import failed
Change print("fieldType invalid!") exit(1) To raise ValueError("fieldType invalid!")
This is strange because we tested it with Python 3.9 and it worked without a problem. So we could not reproduce the issue. Which OS are you using? Are you using Anaconda/Miniconda Python, which version?
Description
Error on import in Python3.9
Steps to reproduce issue
----> 1 import pyofm
/raid/software/python/pyenv/jammy/env/lib/python3.9/site-packages/pyofm/init.py in
1 version = '1.2.2'
2
----> 3 from .pyOFM import PYOFM
/raid/software/python/pyenv/jammy/env/lib/python3.9/site-packages/pyofm/pyOFM.py in
15 from mpi4py import MPI
16 import gzip
---> 17 from .pyOFMesh import pyOFMesh
18
19
pyOFMesh.pyx in init pyOFMesh()
NameError: name 'exit' is not defined
Current behavior
Import failed
suggested Fix
Change print("fieldType invalid!") exit(1) To raise ValueError("fieldType invalid!")