From 27006a59316ad355b8e45ea3fccd84d18c0b8c78 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:08:49 -0400 Subject: [PATCH] use importlib.machinery instead of imp --- enscons/cpyext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enscons/cpyext.py b/enscons/cpyext.py index cf5a406..d03e863 100644 --- a/enscons/cpyext.py +++ b/enscons/cpyext.py @@ -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): @@ -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