Merged revisions 77735 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77735 | benjamin.peterson | 2010-01-24 21:31:13 -0600 (Sun, 24 Jan 2010) | 1 line

  fix an UnboundLocalError when the release file is empty #7773
........
This commit is contained in:
Benjamin Peterson 2010-01-25 03:35:04 +00:00
parent 7671709ec6
commit 00b9051a7e
4 changed files with 28 additions and 2 deletions

View file

@ -247,6 +247,12 @@ _supported_dists = (
def _parse_release_file(firstline):
# Default to empty 'version' and 'id' strings. Both defaults are used
# when 'firstline' is empty. 'id' defaults to empty when an id can not
# be deduced.
version = ''
id = ''
# Parse the first line
m = _lsb_release_version.match(firstline)
if m is not None:
@ -264,8 +270,6 @@ def _parse_release_file(firstline):
version = l[0]
if len(l) > 1:
id = l[1]
else:
id = ''
return '', version, id
def _test_parse_release_file():