Strip double quotes explicitly while parsing /etc/os-release

pull/966/head
Alessio Sergi 2016-11-11 13:22:22 +01:00
parent 842f65dbf2
commit 5c133a9571
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def _linux_os_release():
for line in f: for line in f:
for key in keys: for key in keys:
if line.startswith(key): if line.startswith(key):
ashtray[key] = line.strip().split('=')[1][1:-1] ashtray[key] = re.sub(r'^"|"$', '', line.strip().split('=')[1])
except (OSError, IOError): except (OSError, IOError):
return pretty_name return pretty_name