1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

python: bulk convert zip to list

In py3, zip will return a iterator other than a list.
Convert it to a list to support both py2 and py3.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Joe Guo 2018-04-10 15:49:40 +12:00 committed by Douglas Bagnall
parent 8432ca2b48
commit 5258add3aa
2 changed files with 4 additions and 4 deletions

View File

@ -1398,9 +1398,9 @@ def replay(conversations,
print(("we have %d accounts but %d conversations" %
(accounts, conversations)), file=sys.stderr)
cstack = zip(sorted(conversations,
key=lambda x: x.start_time, reverse=True),
accounts)
cstack = list(zip(
sorted(conversations, key=lambda x: x.start_time, reverse=True),
accounts))
# Set the process group so that the calling scripts are not killed
# when the forked child processes are killed.

View File

@ -73,7 +73,7 @@ class DotFileTests(samba.tests.TestCaseInTempDir):
def test_basic_dot_files(self):
vertices = tuple('abcdefgh')
all_edges = tuple(itertools.combinations(vertices, 2))
line_edges = zip(vertices[1:], vertices[:-1])
line_edges = list(zip(vertices[1:], vertices[:-1]))
ring_edges = line_edges + [(vertices[0], vertices[-1])]
no_edges = []
# even join to even numbers, odd to odd