-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply changes from importlib_metadata 6.5.0
- Loading branch information
Showing
4 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import contextlib | ||
|
||
|
||
# from jaraco.context 4.3 | ||
class suppress(contextlib.suppress, contextlib.ContextDecorator): | ||
""" | ||
A version of contextlib.suppress with decorator support. | ||
>>> @suppress(KeyError) | ||
... def key_error(): | ||
... {}[''] | ||
>>> key_error() | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
Misc/NEWS.d/next/Library/2023-04-16-19-48-21.gh-issue-103584.3mBTuM.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Updated ``importlib.metadata`` with changes from ``importlib_metadata`` 5.2 | ||
through 6.4.1, including: Support ``installed-files.txt`` for | ||
through 6.5.0, including: Support ``installed-files.txt`` for | ||
``Distribution.files`` when present. ``PackageMetadata`` now stipulates an | ||
additional ``get`` method allowing for easy querying of metadata keys that | ||
may not be present. ``packages_distributions`` now honors packages and | ||
modules with Python modules that not ``.py`` sources (e.g. ``.pyc``, | ||
``.so``). Expand protocol for ``PackageMetadata.get_all`` to match the | ||
upstream implementation of ``email.message.Message.get_all`` in | ||
python/typeshed#9620. Declared ``Distribution`` as an abstract class, | ||
enforcing definition of abstract methods in instantiated subclasses. | ||
Deprecated expectation that ``PackageMetadata.__getitem__`` will return | ||
``None`` for missing keys. In the future, it will raise a ``KeyError``. | ||
python/typeshed#9620. Deprecated use of ``Distribution`` without defining | ||
abstract methods. Deprecated expectation that | ||
``PackageMetadata.__getitem__`` will return ``None`` for missing keys. In | ||
the future, it will raise a ``KeyError``. |