From fcc491bf3b814cfada6a85d6054fbb39357fb491 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 9 Nov 2020 15:08:56 -0500 Subject: [PATCH] Port to Python 3. --- src/allmydata/test/mutable/util.py | 15 +++++++++++++-- src/allmydata/util/_python3.py | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/mutable/util.py b/src/allmydata/test/mutable/util.py index 07d4e74e4..2d14994f4 100644 --- a/src/allmydata/test/mutable/util.py +++ b/src/allmydata/test/mutable/util.py @@ -1,4 +1,15 @@ -from future.utils import bchr +""" +Ported to Python 3. +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from future.utils import PY2, bchr +if PY2: + from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401 + from past.builtins import long from io import BytesIO @@ -130,7 +141,7 @@ class FakeStorageServer(object): tw_vectors, read_vector): # always-pass: parrot the test vectors back to them. readv = {} - for shnum, (testv, writev, new_length) in tw_vectors.items(): + for shnum, (testv, writev, new_length) in list(tw_vectors.items()): for (offset, length, op, specimen) in testv: assert op in (b"le", b"eq", b"ge") # TODO: this isn't right, the read is controlled by read_vector, diff --git a/src/allmydata/util/_python3.py b/src/allmydata/util/_python3.py index f59e93eb2..fe43692fb 100644 --- a/src/allmydata/util/_python3.py +++ b/src/allmydata/util/_python3.py @@ -64,6 +64,7 @@ PORTED_MODULES = [ "allmydata.storage.server", "allmydata.storage.shares", "allmydata.test.no_network", + "allmydata.test.mutable.util", "allmydata.uri", "allmydata.util._python3", "allmydata.util.abbreviate",