Skip to content

Commit

Permalink
use importlib.machinery instead of imp
Browse files Browse the repository at this point in the history
  • Loading branch information
dholth committed Jul 20, 2024
1 parent 4fa7342 commit 27006a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enscons/cpyext.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27006a5

Please sign in to comment.