Commit 41b7184c authored by Stefan Behnel's avatar Stefan Behnel

simplify some code

parent 05004154
...@@ -196,15 +196,14 @@ class DistutilsInfo(object): ...@@ -196,15 +196,14 @@ class DistutilsInfo(object):
self.values = {} self.values = {}
if source is not None: if source is not None:
for line in line_iter(source): for line in line_iter(source):
line = line.strip() line = line.lstrip()
if line != '' and line[0] != '#': if not line:
continue
if line[0] != '#':
break break
line = line[1:].strip() line = line[1:].lstrip()
if line[:10] == 'distutils:': if line[:10] == 'distutils:':
line = line[10:] key, _, value = [s.strip() for s in line[10:].partition('=')]
ix = line.index('=')
key = str(line[:ix].strip())
value = line[ix+1:].strip()
type = distutils_settings[key] type = distutils_settings[key]
if type in (list, transitive_list): if type in (list, transitive_list):
value = parse_list(value) value = parse_list(value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment