-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.12 builds fail because imp
has been deprecated and removed
#41
Comments
This patch should fix the --- a/enscons/cpyext.py
+++ b/enscons/cpyext.py
@@ -10,8 +10,8 @@ from distutils.core import Distribution
from distutils.extension import Extension
from distutils.command.build_ext import build_ext
-import imp
import importlib
+import importlib.machinery
# not used when generate is passed directly to Environment
def exists(env):
@@ -88,7 +88,7 @@ def get_build_ext(name="zoot"):
# from setuptools
def get_abi3_suffix():
"""Return the file extension for an abi3-compliant Extension()"""
- for suffix, _, _ in (s for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION):
+ for suffix in importlib.machinery.EXTENSION_SUFFIXES:
if ".abi3" in suffix: # Unix
return suffix
elif suffix == ".pyd": # Windows But then |
Yes, enscons would prefer to be patched to work with Python 3.12 Too bad that we use distutils to get compiler information. Although perhaps its sauce is not that secret? (IIRC there are only a few revelant cflags) |
Thanks. Do you have time to look over the PR? CC @tseaver @charliermarsh @richardkiss Sometimes it seems like github prioritizes notifications from "every random project except my own". |
Title, https://docs.python.org/3.11/library/imp.html
The text was updated successfully, but these errors were encountered: