Follow pattern where field is set if value exists

This commit is contained in:
Connor Osborn 2016-07-20 21:35:43 -07:00
parent e32d7430f0
commit 8e9fca27d8
1 changed files with 1 additions and 3 deletions

View File

@ -86,13 +86,11 @@ def search_packages_info(query):
entry_points = dist.get_metadata_lines('entry_points.txt')
package['entry_points'] = entry_points
installer = None
if dist.has_metadata('INSTALLER'):
for line in dist.get_metadata_lines('INSTALLER'):
if line.strip():
installer = line.strip()
package['installer'] = line.strip()
break
package['installer'] = installer
# @todo: Should pkg_resources.Distribution have a
# `get_pkg_info` method?