diff --git a/src/allmydata/immutable/downloader/__init__.py b/src/allmydata/immutable/downloader/__init__.py index e69de29bb..2d3d9e2a4 100644 --- a/src/allmydata/immutable/downloader/__init__.py +++ b/src/allmydata/immutable/downloader/__init__.py @@ -0,0 +1,13 @@ +""" +Ported to Python 3. +""" + +from __future__ import unicode_literals +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +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 + diff --git a/src/allmydata/immutable/downloader/status.py b/src/allmydata/immutable/downloader/status.py index 4cb1cc513..7e7c88fc8 100644 --- a/src/allmydata/immutable/downloader/status.py +++ b/src/allmydata/immutable/downloader/status.py @@ -1,3 +1,14 @@ +""" +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 itertools from zope.interface import implementer @@ -257,7 +268,7 @@ class DownloadStatus(object): # else ignore completed requests if not total_outstanding: return 1.0 - return 1.0 * total_received / total_outstanding + return total_received / total_outstanding def using_helper(self): return False diff --git a/src/allmydata/util/_python3.py b/src/allmydata/util/_python3.py index ce9cf353d..4f1dddab1 100644 --- a/src/allmydata/util/_python3.py +++ b/src/allmydata/util/_python3.py @@ -33,6 +33,8 @@ PORTED_MODULES = [ "allmydata.crypto.util", "allmydata.hashtree", "allmydata.immutable.happiness_upload", + "allmydata.immutable.downloader", + "allmydata.immutable.downloader.status", "allmydata.interfaces", "allmydata.introducer.interfaces", "allmydata.monitor",