mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-132947: Apply changes from importlib_metadata 8.7 (#137885)
* Copied files from python/importlib_metadata@b67ac80c49.
This commit is contained in:
parent
918e3ba6c0
commit
5292fc00f2
12 changed files with 294 additions and 122 deletions
15
Lib/importlib/metadata/_typing.py
Normal file
15
Lib/importlib/metadata/_typing.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import functools
|
||||
import typing
|
||||
|
||||
from ._meta import PackageMetadata
|
||||
|
||||
md_none = functools.partial(typing.cast, PackageMetadata)
|
||||
"""
|
||||
Suppress type errors for optional metadata.
|
||||
|
||||
Although Distribution.metadata can return None when metadata is corrupt
|
||||
and thus None, allow callers to assume it's not None and crash if
|
||||
that's the case.
|
||||
|
||||
# python/importlib_metadata#493
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue