mdolab / mdolab/pyofm

Import fails in python 3.9

Open
#13 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pyOFMesh.pyx, using the import traceback and the fieldType invalid branch described in the issue. Verify the import failure with Python 3.9, make the suggested error-handling change, and confirm that importing pyofm succeeds while invalid fieldType input reports the expected error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.