summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-08-31 18:16:41 +0200
committerVictor Stinner <vstinner@python.org>2020-09-01 16:41:24 +0200
commitdf8c341bacb103e085d6714bf9778f008a56cb04 (patch)
tree78b18e9f01a4fe5362ac48d4b2e42f5f830b0d10
parent17cb9d6bf249cefe653d3bdb712582409035a7db (diff)
downloadpython-setuptools-git-df8c341bacb103e085d6714bf9778f008a56cb04.tar.gz
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).
-rw-r--r--_distutils_hack/__init__.py3
-rw-r--r--changelog.d/2361.change.rst3
2 files changed, 5 insertions, 1 deletions
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).