GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: remove call to importlib.metadata.packages_distributions() for p… · googleapis/python-api-core@628003e

This repository was archived by the owner on Feb 23, 2026. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/api_core
    • _python_version_support.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/api_core/_python_version_support.py‎

Copy file name to clipboardExpand all lines: google/api_core/_python_version_support.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.