summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-11-28 13:21:54 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-11-28 13:21:54 -0500
commitb062cf374956302edf12fa2ac4407af90b06bc19 (patch)
tree2ea5a186241d548e90325f97ba767a66b4fa7c33
parentcb6324e6e7d712c68fa20ca40ed2f256486fc54e (diff)
downloadpython-setuptools-bitbucket-b062cf374956302edf12fa2ac4407af90b06bc19.tar.gz
Add docstring
-rw-r--r--pkg_resources/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 9a3ca36c..e4decac3 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2467,6 +2467,10 @@ def _remove_md5_fragment(location):
def _version_from_file(lines):
+ """
+ Given an iterable of lines from a Metadata file, return
+ the value of the Version field, if present, or None otherwise.
+ """
is_version_line = lambda line: line.lower().startswith('version:')
version_lines = filter(is_version_line, lines)
line = next(iter(version_lines), '')