Mercurial > cpython-lru_cache-weakref
diff Lib/platform.py @ 58482:0cce60b68e46
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
........
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Mon, 25 Jan 2010 03:37:42 +0000 |
| parents | 89a9dd8c628d |
| children | fdec30aeb93f |
line wrap: on
line diff
--- a/Lib/platform.py Sun Jan 24 20:59:24 2010 +0000 +++ b/Lib/platform.py Mon Jan 25 03:37:42 2010 +0000 @@ -261,6 +261,12 @@ 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: @@ -278,8 +284,6 @@ version = l[0] if len(l) > 1: id = l[1] - else: - id = '' return '', version, id def linux_distribution(distname='', version='', id='',
