From: Stefan Metzmacher Date: Wed, 7 Jan 2015 08:41:02 +0000 (+0100) Subject: wafsamba: let TO_LIST(mylist) return a copy of mylist X-Git-Tag: samba-4.2.0rc5~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb71b4b1aafaa3fae8c19b6d2cfd1b0e40d2ff95;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme (cherry picked from commit ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710) --- diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 0b0bb483781..9ac10666f39 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)