Rewrite ConfigSet._get_list_value_for_modification

This commit is contained in:
Thomas Nagy 2016-03-19 10:26:42 +01:00
parent d54622e341
commit 555507975d
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 12 additions and 8 deletions

View File

@ -19,7 +19,7 @@ Download the project from our page on [waf.io](https://waf.io/) or from the mirr
## HOW TO CREATE THE WAF SCRIPT
Python >= 2.6 3.4 is required to generate the waf script, and the resulting file can then run on Python 2.5.
Python >= 2.6 is required to generate the waf script, and the resulting file can then run on Python 2.5.
Just execute:
```sh
$ ./waf-light configure build

View File

@ -191,16 +191,20 @@ class ConfigSet(object):
try:
value = self.table[key]
except KeyError:
try: value = self.parent[key]
except AttributeError: value = []
if isinstance(value, list):
value = value[:]
try:
value = self.parent[key]
except AttributeError:
value = []
else:
value = [value]
if isinstance(value, list):
# force a copy
value = value[:]
else:
value = [value]
self.table[key] = value
else:
if not isinstance(value, list):
value = [value]
self.table[key] = value
self.table[key] = value = [value]
return value
def append_value(self, var, val):