Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/setup-py…
Browse files Browse the repository at this point in the history
…thon-5
  • Loading branch information
sentrivana authored Feb 5, 2024
2 parents 4707c34 + 738506c commit 2d755df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1666,16 +1666,18 @@ def _generate_installed_modules():
try:
from importlib import metadata

yielded = set()
for dist in metadata.distributions():
name = dist.metadata["Name"]
# `metadata` values may be `None`, see:
# https://github.com/python/cpython/issues/91216
# and
# https://github.com/python/importlib_metadata/issues/371
if name is not None:
version = metadata.version(name)
if version is not None:
yield _normalize_module_name(name), version
normalized_name = _normalize_module_name(name)
if dist.version is not None and normalized_name not in yielded:
yield normalized_name, dist.version
yielded.add(normalized_name)

except ImportError:
# < py3.8
Expand Down

0 comments on commit 2d755df

Please sign in to comment.