Port to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2021-03-23 10:55:14 -04:00
parent e140dc06ea
commit 15d6ab610d
2 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,14 @@
from past.builtins import unicode
"""
Ported to Pythn 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
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 os
import mock
@ -51,7 +61,7 @@ class _FakeWormhole(object):
def _create_fake_wormhole(outgoing_messages):
outgoing_messages = [
m.encode("utf-8") if isinstance(m, unicode) else m
m.encode("utf-8") if isinstance(m, str) else m
for m in outgoing_messages
]
return _FakeWormhole(outgoing_messages)

View File

@ -145,6 +145,7 @@ PORTED_MODULES = [
PORTED_TEST_MODULES = [
"allmydata.test.cli.test_alias",
"allmydata.test.cli.test_create",
"allmydata.test.cli.test_invite",
"allmydata.test.cli.test_status",
"allmydata.test.mutable.test_checker",