diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-01-25 03:37:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-01-25 03:37:42 (GMT) |
commit | 250014793e9ed7d6cfc6e25ac502bcb124895d23 (patch) | |
tree | 3dd61c6675bd5d79e391aeac5b47c1d9a33d96fb /Lib/platform.py | |
parent | b19f43dbf059c46aca0e416bedb43c65c511f42b (diff) | |
download | cpython-250014793e9ed7d6cfc6e25ac502bcb124895d23.zip cpython-250014793e9ed7d6cfc6e25ac502bcb124895d23.tar.gz cpython-250014793e9ed7d6cfc6e25ac502bcb124895d23.tar.bz2 |
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
........
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 0a52587..570f327 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -261,6 +261,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: @@ -278,8 +284,6 @@ def _parse_release_file(firstline): version = l[0] if len(l) > 1: id = l[1] - else: - id = '' return '', version, id def linux_distribution(distname='', version='', id='', |