diff options
author | Stefan Metzmacher <metze@samba.org> | 2015-01-07 09:41:02 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-01-08 23:38:06 +0100 |
commit | ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710 (patch) | |
tree | dcd9c79290f9f35944e9dc7fdad55c288f10dc61 /buildtools | |
parent | 56e2384dfe29fd8f16b9d0cf7264f9bb8ed38966 (diff) | |
download | samba-ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710.tar.gz samba-ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710.tar.xz samba-ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710.zip |
wafsamba: let TO_LIST(mylist) return a copy of mylist
In most cases we have TO_LIST(mystring) which returns an independent
list.
newlist = TO_LIST(mylist) returned just a reference to mylist.
Which means newlist.append("end") would also modify mylist.
TO_LIST() should always return an independent list.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 0b0bb48378..9ac10666f3 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -214,7 +214,8 @@ def TO_LIST(str, delimiter=None): if str is None: return [] if isinstance(str, list): - return str + # we need to return a new independent list... + return list(str) if len(str) == 0: return [] lst = str.split(delimiter) |