1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Stefan Metzmacher 2015-01-07 09:41:02 +01:00 committed by Jeremy Allison
parent 56e2384dfe
commit ab4b988ba2

View File

@ -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)