Ported to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2020-11-11 14:45:20 -05:00
parent d0d7a82734
commit 9e2a79ee23
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,15 @@
"""
Ported to Python 3.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import PY2
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
import os, time
from io import BytesIO
from itertools import count
@ -446,7 +458,7 @@ class Publish(object):
# then we add in all the shares that were bad (corrupted, bad
# signatures, etc). We want to replace these.
for key, old_checkstring in self._servermap.get_bad_shares().items():
for key, old_checkstring in list(self._servermap.get_bad_shares().items()):
(server, shnum) = key
self.goal.add( (server,shnum) )
self.bad_share_checkstrings[(server,shnum)] = old_checkstring
@ -1105,7 +1117,7 @@ class Publish(object):
self.bad_servers.add(server) # don't ask them again
# use the checkstring to add information to the log message
unknown_format = False
for (shnum,readv) in read_data.items():
for (shnum,readv) in list(read_data.items()):
checkstring = readv[0]
version = get_version_from_checkstring(checkstring)
if version == MDMF_VERSION:

View File

@ -56,6 +56,7 @@ PORTED_MODULES = [
"allmydata.mutable.checker",
"allmydata.mutable.common",
"allmydata.mutable.filenode",
"allmydata.mutable.publish",
"allmydata.node",
"allmydata.storage_client",
"allmydata.storage.common",