pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/bcced02604f845b2b71d0a1dd95f95366bd7774d

aa60c69660fa.css" /> gh-140141: Properly break exception chain in `importlib.metadata.Dist… · python/cpython@bcced02 · GitHub
Skip to content

Commit bcced02

Browse files
authored
gh-140141: Properly break exception chain in importlib.metadata.Distribution.from_name (#140142)
1 parent f673f0e commit bcced02

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/importlib/metadata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def from_name(cls, name: str) -> Distribution:
457457
try:
458458
return next(iter(cls._prefer_valid(cls.discover(name=name))))
459459
except StopIteration:
460-
raise PackageNotFoundError(name)
460+
raise PackageNotFoundError(name) from None
461461

462462
@classmethod
463463
def discover(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The :py:class:`importlib.metadata.PackageNotFoundError` traceback raised when
2+
``importlib.metadata.Distribution.from_name`` cannot discover a
3+
distribution no longer includes a transient :exc:`StopIteration` exception trace.
4+
5+
Contributed by Bartosz Sławecki in :gh:`140142`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy