summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-25 03:40:53 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-25 03:40:53 (GMT)
commit79e0b818c577656c8ecc3576b5f34976a4cdff48 (patch)
tree2d8214beda9aa271cc5644422228b17919a68a91 /Lib/platform.py
parentfcdf9f215e9f304e362b47da7417e6117db7f5ed (diff)
downloadcpython-79e0b818c577656c8ecc3576b5f34976a4cdff48.zip
cpython-79e0b818c577656c8ecc3576b5f34976a4cdff48.tar.gz
cpython-79e0b818c577656c8ecc3576b5f34976a4cdff48.tar.bz2
Merged revisions 77737 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77737 | benjamin.peterson | 2010-01-24 21:37:42 -0600 (Sun, 24 Jan 2010) | 9 lines 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-xLib/platform.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index 737198f..d5100a8 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -245,6 +245,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:
@@ -262,8 +268,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='',