Skip to content

Avoid imp import on Python 3 - #722

Draft
Mirochill wants to merge 1 commit into
threedworld-mit:masterfrom
Mirochill:fix-719-remove-imp
Draft

Avoid imp import on Python 3#722
Mirochill wants to merge 1 commit into
threedworld-mit:masterfrom
Mirochill:fix-719-remove-imp

Conversation

@Mirochill

Copy link
Copy Markdown

Fixes #719.

Summary:

  • avoid importing the removed imp module at tdw.flatbuffers.compat import time on Python 3
  • use importlib.util.find_spec(numpy) for the Python 3 optional-NumPy check
  • keep the existing imp.find_module() path only for Python 2 compatibility

This does not change the advertised Python classifiers; it only removes the immediate import-time blocker reported in the issue.

Validation:

  • git diff --check HEAD~1..HEAD
  • Static search confirmed remaining imp references are under the PY2 branch, and the Python 3 path uses find_spec.
  • Not run locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'imp'

1 participant