File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,11 @@ def _flatten_message(text: str) -> str:
151151 return " " .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
158160 def _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):
172174 if module_name in module_to_distributions : # pragma: NO COVER
173175 # The value is a list of distribution names, take the first one
174176 return 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" ,
178180 module_name ,
You can’t perform that action at this time.
0 commit comments