Port to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2020-08-12 15:45:21 -04:00
parent 5a0fa7ff73
commit 5c9294ebf1
2 changed files with 13 additions and 0 deletions

View File

@ -32,6 +32,7 @@ PORTED_MODULES = [
"allmydata.util.deferredutil",
"allmydata.util.fileutil",
"allmydata.util.dictutil",
"allmydata.util.encodingutil",
"allmydata.util.gcutil",
"allmydata.util.hashutil",
"allmydata.util.humanreadable",

View File

@ -1,9 +1,21 @@
"""
Functions used to convert inputs from whatever encoding used in the system to
unicode and back.
Ported to Python 3.
Once Python 2 support is dropped, most of this module will obsolete, since
Unicode is the default everywhere in Python 3.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import PY2, PY3, native_str
if PY2:
# We omit str() because that seems too tricky to get right.
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, max, min # noqa: F401
from past.builtins import unicode