From 03da59c07d0e93d67523356821acc66b34fa5c5c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jul 2022 12:07:48 -0400 Subject: [PATCH] Apply workaround on all versions of Python. Fixes #3452. --- setuptools/_importlib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setuptools/_importlib.py b/setuptools/_importlib.py index 819bf5d3c2..400cf60abe 100644 --- a/setuptools/_importlib.py +++ b/setuptools/_importlib.py @@ -6,7 +6,7 @@ def disable_importlib_metadata_finder(metadata): Ensure importlib_metadata doesn't provide older, incompatible Distributions. - Workaround for #3102. + Workaround for #3102 and #3452. """ try: import importlib_metadata @@ -36,11 +36,13 @@ def disable_importlib_metadata_finder(metadata): if sys.version_info < (3, 10): from setuptools.extern import importlib_metadata as metadata - disable_importlib_metadata_finder(metadata) else: import importlib.metadata as metadata # noqa: F401 +disable_importlib_metadata_finder(metadata) + + if sys.version_info < (3, 9): from setuptools.extern import importlib_resources as resources else: