PY3: enclose filter with list as len on result of filter fails
authorNoel Power <noel.power@suse.com>
Thu, 2 Aug 2018 13:42:55 +0000 (14:42 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 16 Sep 2018 04:16:19 +0000 (06:16 +0200)
filter returns an iterator in PY3 (and a list in PY2)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_abi.py

index 2f2882d742ec2425169be8045e7e352de6853a54..70bd42cc311a5e1d65ef615c0f15a59233cf44f1 100644 (file)
@@ -190,8 +190,8 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
         f.write("}%s;\n\n" % last_key)
         last_key = " %s" % symver
     f.write("%s {\n" % current_version)
-    local_abi = filter(lambda x: x[0] == '!', abi_match)
-    global_abi = filter(lambda x: x[0] != '!', abi_match)
+    local_abi = list(filter(lambda x: x[0] == '!', abi_match))
+    global_abi = list(filter(lambda x: x[0] != '!', abi_match))
     f.write("\tglobal:\n")
     if len(global_abi) > 0:
         for x in global_abi: