This repository was archived by the owner on Feb 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,9 +151,11 @@ def _flatten_message(text: str) -> str:
151151return " " .join (textwrap .dedent (text ).strip ().split ())
152152
153153
154- # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove once we
155- # no longer support Python 3.7
156- if sys .version_info < (3 , 8 ):
154+ # TODO(https://github.com/googleapis/python-api-core/issues/835):
155+ # Remove once we no longer support Python 3.9.
156+ # `importlib.metadata.packages_distributions()` is only supported in Python 3.10 and newer
157+ # https://docs.python.org/3/library/importlib.metadata.html#importlib.metadata.packages_distributions
158+ if sys .version_info < (3 , 10 ):
157159
158160def _get_pypi_package_name (module_name ): # pragma: NO COVER
159161"""Determine the PyPI package name for a given module name."""
@@ -172,7 +174,7 @@ def _get_pypi_package_name(module_name):
172174if module_name in module_to_distributions : # pragma: NO COVER
173175# The value is a list of distribution names, take the first one
174176return module_to_distributions [module_name ][0 ]
175- except Exception as e :
177+ except Exception as e :# pragma: NO COVER
176178_LOGGER .info (
177179"An error occurred while determining PyPI package name for %s: %s" ,
178180module_name ,
You can’t perform that action at this time.
0 commit comments