mirror of https://github.com/pypa/pip
Merge pull request #8528 from chrahunt/simplify-get-entrypoints
Remove redundant entrypoint text normalization
This commit is contained in:
commit
8097de5364
|
@ -122,16 +122,8 @@ def get_entrypoints(filename):
|
|||
if not os.path.exists(filename):
|
||||
return {}, {}
|
||||
|
||||
# This is done because you can pass a string to entry_points wrappers which
|
||||
# means that they may or may not be valid INI files. The attempt here is to
|
||||
# strip leading and trailing whitespace in order to make them valid INI
|
||||
# files.
|
||||
with io.open(filename, encoding="utf-8") as fp:
|
||||
data = io.StringIO()
|
||||
for line in fp:
|
||||
data.write(line.strip())
|
||||
data.write(u"\n")
|
||||
data.seek(0)
|
||||
data = fp.read()
|
||||
|
||||
# get the entry points and then the script names
|
||||
entry_points = pkg_resources.EntryPoint.parse_map(data)
|
||||
|
|
Loading…
Reference in New Issue