mdolab / pyofm

Python wrapper for OpenFOAM meshes
Other
7 stars 4 forks source link

Import fails in python 3.9 #13

Open gadieid opened 5 months ago

gadieid commented 5 months ago

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!")

friedenhe commented 5 months ago

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?