Port to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2020-10-06 11:32:19 -04:00
parent 1a9c4232aa
commit 3e87ba368e
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,18 @@
# -*- test-case-name: allmydata.test.test_encode -*-
"""
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 time
from zope.interface import implementer
from twisted.internet import defer
@ -468,7 +481,7 @@ class Encoder(object):
(self,
self.segment_size*(segnum+1),
self.segment_size*self.num_segments,
100 * (segnum+1) / self.num_segments,
100 * (segnum+1) // self.num_segments,
),
level=log.OPERATIONAL)
elapsed = time.time() - start

View File

@ -40,6 +40,7 @@ PORTED_MODULES = [
"allmydata.immutable.downloader.segmentation",
"allmydata.immutable.downloader.share",
"allmydata.immutable.downloader.status",
"allmydata.immutable.encode",
"allmydata.immutable.happiness_upload",
"allmydata.immutable.literal",
"allmydata.interfaces",