From cb71b4b1aafaa3fae8c19b6d2cfd1b0e40d2ff95 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 7 Jan 2015 09:41:02 +0100 Subject: [PATCH] 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) --- buildtools/wafsamba/samba_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.47.2