From df8c341bacb103e085d6714bf9778f008a56cb04 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 31 Aug 2020 18:16:41 +0200 Subject: Add Python 3.10 support to _distutils_hack Get the 'Loader' abstract class from importlib.abc rather than importlib.util.abc (alias removed in Python 3.10). --- _distutils_hack/__init__.py | 3 ++- changelog.d/2361.change.rst | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/2361.change.rst diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index 074bd5e9..b8410e1f 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py @@ -74,9 +74,10 @@ class DistutilsMetaFinder: return method() def spec_for_distutils(self): + import importlib.abc import importlib.util - class DistutilsLoader(importlib.util.abc.Loader): + class DistutilsLoader(importlib.abc.Loader): def create_module(self, spec): return importlib.import_module('._distutils', 'setuptools') diff --git a/changelog.d/2361.change.rst b/changelog.d/2361.change.rst new file mode 100644 index 00000000..6db769c4 --- /dev/null +++ b/changelog.d/2361.change.rst @@ -0,0 +1,3 @@ +Add Python 3.10 support to _distutils_hack. Get the 'Loader' abstract class +from importlib.abc rather than importlib.util.abc (alias removed in Python +3.10). -- cgit v1.2.1