mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #7237 from hulu/avoid-pip-shadowing
avoid shadowing `version()` in pip.list_()
This commit is contained in:
commit
302e317542
@ -771,19 +771,19 @@ def list_(prefix=None,
|
|||||||
continue
|
continue
|
||||||
elif line.startswith('-e'):
|
elif line.startswith('-e'):
|
||||||
line = line.split('-e ')[1]
|
line = line.split('-e ')[1]
|
||||||
version, name = line.split('#egg=')
|
version_, name = line.split('#egg=')
|
||||||
elif len(line.split('==')) >= 2:
|
elif len(line.split('==')) >= 2:
|
||||||
name = line.split('==')[0]
|
name = line.split('==')[0]
|
||||||
version = line.split('==')[1]
|
version_ = line.split('==')[1]
|
||||||
else:
|
else:
|
||||||
logger.error("Can't parse line '%s'", line)
|
logger.error("Can't parse line '%s'", line)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if prefix:
|
if prefix:
|
||||||
if name.lower().startswith(prefix.lower()):
|
if name.lower().startswith(prefix.lower()):
|
||||||
packages[name] = version
|
packages[name] = version_
|
||||||
else:
|
else:
|
||||||
packages[name] = version
|
packages[name] = version_
|
||||||
return packages
|
return packages
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user