diff --git a/src/allmydata/immutable/encode.py b/src/allmydata/immutable/encode.py index fb6733cf7..9351df501 100644 --- a/src/allmydata/immutable/encode.py +++ b/src/allmydata/immutable/encode.py @@ -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 diff --git a/src/allmydata/util/_python3.py b/src/allmydata/util/_python3.py index 04b5651db..6be9077b0 100644 --- a/src/allmydata/util/_python3.py +++ b/src/allmydata/util/_python3.py @@ -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",