Port abbreviate.py. As far as I can tell, all division is already float division.

This commit is contained in:
Itamar Turner-Trauring 2020-07-21 14:15:39 -04:00
parent 116f232e80
commit 4018b772a3
3 changed files with 18 additions and 0 deletions

View File

@ -1,6 +1,14 @@
"""
Tests for allmydata.util.abbreviate.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import PY2
if PY2:
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, int, list, object, range, str, max, min # noqa: F401
from datetime import timedelta

View File

@ -15,6 +15,7 @@ if PY2:
# Keep these sorted alphabetically, to reduce merge conflicts:
PORTED_MODULES = [
"allmydata.util.abbreviate",
"allmydata.util.assertutil",
"allmydata.util.deferredutil",
"allmydata.util.humanreadable",
@ -27,6 +28,7 @@ PORTED_MODULES = [
]
PORTED_TEST_MODULES = [
"allmydata.test.test_abbreviate",
"allmydata.test.test_deferredutil",
"allmydata.test.test_humanreadable",
"allmydata.test.test_python3",

View File

@ -1,3 +1,11 @@
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 builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, int, list, object, range, str, max, min # noqa: F401
import re
from datetime import timedelta