mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
Update implementation based on importlib_metadata 0.10
This commit is contained in:
parent
a1d873b7d6
commit
6d7e3a8592
6 changed files with 113 additions and 170 deletions
|
@ -179,7 +179,14 @@ class Distribution:
|
|||
The returned object will have keys that name the various bits of
|
||||
metadata. See PEP 566 for details.
|
||||
"""
|
||||
text = self.read_text('METADATA') or self.read_text('PKG-INFO')
|
||||
text = (
|
||||
self.read_text('METADATA')
|
||||
or self.read_text('PKG-INFO')
|
||||
# This last clause is here to support old egg-info files. Its
|
||||
# effect is to just end up using the PathDistribution's self._path
|
||||
# (which points to the egg-info file) attribute unchanged.
|
||||
or self.read_text('')
|
||||
)
|
||||
return email.message_from_string(text)
|
||||
|
||||
@property
|
||||
|
@ -230,7 +237,7 @@ class Distribution:
|
|||
|
||||
def _read_egg_info_reqs(self):
|
||||
source = self.read_text('requires.txt')
|
||||
return self._deps_from_requires_text(source)
|
||||
return source and self._deps_from_requires_text(source)
|
||||
|
||||
@classmethod
|
||||
def _deps_from_requires_text(cls, source):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue