Merge pull request #1023 from tahoe-lafs/3655.__init__-python-3

Port __init__.py modules to Python 3

Fixes ticket:3655.
This commit is contained in:
Itamar Turner-Trauring 2021-03-30 15:06:58 -04:00 committed by GitHub
commit 75ca085f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 3 deletions

0
newsfragments/3655.minor Normal file
View File

View File

@ -3,6 +3,16 @@ Decentralized storage grid.
community web site: U{https://tahoe-lafs.org/} community web site: U{https://tahoe-lafs.org/}
""" """
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:
# Don't import future str() so we don't break Foolscap serialization on Python 2.
from future.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 as str
__all__ = [ __all__ = [
"__version__", "__version__",

View File

@ -1,3 +1,16 @@
"""
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
from allmydata.introducer.server import create_introducer from allmydata.introducer.server import create_introducer

View File

@ -12,9 +12,17 @@ Some setup that should apply across the entire test suite.
Rather than defining interesting APIs for other code to use, this just causes Rather than defining interesting APIs for other code to use, this just causes
some side-effects which make things better when the test suite runs. some side-effects which make things better when the test suite runs.
"""
from future.utils import PY3 Ported to 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
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 warnings import warnings
from traceback import extract_stack, format_list from traceback import extract_stack, format_list
@ -124,4 +132,4 @@ if sys.platform == "win32":
from eliot import to_file from eliot import to_file
from allmydata.util.jsonbytes import BytesJSONEncoder from allmydata.util.jsonbytes import BytesJSONEncoder
to_file(open("eliot.log", "w"), encoder=BytesJSONEncoder) to_file(open("eliot.log", "wb"), encoder=BytesJSONEncoder)

View File

@ -24,6 +24,7 @@ if PY2:
# Keep these sorted alphabetically, to reduce merge conflicts: # Keep these sorted alphabetically, to reduce merge conflicts:
PORTED_MODULES = [ PORTED_MODULES = [
"allmydata",
"allmydata.__main__", "allmydata.__main__",
"allmydata._auto_deps", "allmydata._auto_deps",
"allmydata._monkeypatch", "allmydata._monkeypatch",
@ -40,9 +41,11 @@ PORTED_MODULES = [
"allmydata.crypto.util", "allmydata.crypto.util",
"allmydata.deep_stats", "allmydata.deep_stats",
"allmydata.dirnode", "allmydata.dirnode",
"allmydata.frontends",
"allmydata.frontends.sftpd", "allmydata.frontends.sftpd",
"allmydata.hashtree", "allmydata.hashtree",
"allmydata.history", "allmydata.history",
"allmydata.immutable",
"allmydata.immutable.checker", "allmydata.immutable.checker",
"allmydata.immutable.downloader", "allmydata.immutable.downloader",
"allmydata.immutable.downloader.common", "allmydata.immutable.downloader.common",
@ -61,11 +64,13 @@ PORTED_MODULES = [
"allmydata.immutable.repairer", "allmydata.immutable.repairer",
"allmydata.immutable.upload", "allmydata.immutable.upload",
"allmydata.interfaces", "allmydata.interfaces",
"allmydata.introducer",
"allmydata.introducer.client", "allmydata.introducer.client",
"allmydata.introducer.common", "allmydata.introducer.common",
"allmydata.introducer.interfaces", "allmydata.introducer.interfaces",
"allmydata.introducer.server", "allmydata.introducer.server",
"allmydata.monitor", "allmydata.monitor",
"allmydata.mutable",
"allmydata.mutable.checker", "allmydata.mutable.checker",
"allmydata.mutable.common", "allmydata.mutable.common",
"allmydata.mutable.filenode", "allmydata.mutable.filenode",
@ -76,10 +81,12 @@ PORTED_MODULES = [
"allmydata.mutable.servermap", "allmydata.mutable.servermap",
"allmydata.node", "allmydata.node",
"allmydata.nodemaker", "allmydata.nodemaker",
"allmydata.scripts",
"allmydata.scripts.create_node", "allmydata.scripts.create_node",
"allmydata.scripts.types_", "allmydata.scripts.types_",
"allmydata.stats", "allmydata.stats",
"allmydata.storage_client", "allmydata.storage_client",
"allmydata.storage",
"allmydata.storage.common", "allmydata.storage.common",
"allmydata.storage.crawler", "allmydata.storage.crawler",
"allmydata.storage.expirer", "allmydata.storage.expirer",
@ -88,12 +95,18 @@ PORTED_MODULES = [
"allmydata.storage.mutable", "allmydata.storage.mutable",
"allmydata.storage.server", "allmydata.storage.server",
"allmydata.storage.shares", "allmydata.storage.shares",
"allmydata.test",
"allmydata.test.cli",
"allmydata.test.no_network", "allmydata.test.no_network",
"allmydata.test.matchers", "allmydata.test.matchers",
"allmydata.test.mutable",
"allmydata.test.mutable.util", "allmydata.test.mutable.util",
"allmydata.test.web",
"allmydata.testing",
"allmydata.testing.web", "allmydata.testing.web",
"allmydata.unknown", "allmydata.unknown",
"allmydata.uri", "allmydata.uri",
"allmydata.util",
"allmydata.util._python3", "allmydata.util._python3",
"allmydata.util.abbreviate", "allmydata.util.abbreviate",
"allmydata.util.assertutil", "allmydata.util.assertutil",
@ -125,6 +138,7 @@ PORTED_MODULES = [
"allmydata.util.statistics", "allmydata.util.statistics",
"allmydata.util.time_format", "allmydata.util.time_format",
"allmydata.util.tor_provider", "allmydata.util.tor_provider",
"allmydata.web",
"allmydata.web.check_results", "allmydata.web.check_results",
"allmydata.web.common", "allmydata.web.common",
"allmydata.web.directory", "allmydata.web.directory",
@ -140,6 +154,7 @@ PORTED_MODULES = [
"allmydata.web.storage_plugins", "allmydata.web.storage_plugins",
"allmydata.web.unlinked", "allmydata.web.unlinked",
"allmydata.webish", "allmydata.webish",
"allmydata.windows",
] ]
PORTED_TEST_MODULES = [ PORTED_TEST_MODULES = [