From a0851c5fdcd8463b571a00929a9bf492f35a92c0 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 3 Aug 2018 18:45:35 +0100 Subject: [PATCH] PY3: wrap filter calls with list where list is expected filter in PY2 returns list in PY3 it returns an iterator Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- selftest/selftesthelpers.py | 2 +- source4/selftest/tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py index ab34563cc48..7d469e3f35a 100644 --- a/selftest/selftesthelpers.py +++ b/selftest/selftesthelpers.py @@ -187,7 +187,7 @@ def plansmbtorture4testsuite(name, env, options, target, modname=None): def smbtorture4_testsuites(prefix): - return filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list) + return list(filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list)) smbclient3 = binpath('smbclient') diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index be3ee689608..18037524627 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -323,7 +323,7 @@ smb2_s3only = [ smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only] # The QFILEINFO-IPC test needs to be on ipc$ -raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw.")) +raw = list(filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw."))) base = smbtorture4_testsuites("base.") netapi = smbtorture4_testsuites("netapi.")