mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-05-29 13:54:23 +00:00
Port to Python 3.
This commit is contained in:
parent
ba42483741
commit
96fd1861d2
@ -9,7 +9,8 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from future.utils import PY2
|
from future.utils import PY2
|
||||||
if 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
|
# Skip dict so it doesn't break things.
|
||||||
|
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, list, object, range, str, max, min # noqa: F401
|
||||||
from past.builtins import unicode
|
from past.builtins import unicode
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@ -268,8 +269,9 @@ def _pack_normalized_children(children, writekey, deep_immutable=False):
|
|||||||
(child, metadata) = children[name]
|
(child, metadata) = children[name]
|
||||||
child.raise_error()
|
child.raise_error()
|
||||||
if deep_immutable and not child.is_allowed_in_immutable_directory():
|
if deep_immutable and not child.is_allowed_in_immutable_directory():
|
||||||
raise MustBeDeepImmutableError("child %s is not allowed in an immutable directory" %
|
raise MustBeDeepImmutableError(
|
||||||
quote_output(name, encoding='utf-8'), name)
|
"child %r is not allowed in an immutable directory" % (name,),
|
||||||
|
name)
|
||||||
if has_aux:
|
if has_aux:
|
||||||
entry = children.get_aux(name)
|
entry = children.get_aux(name)
|
||||||
if not entry:
|
if not entry:
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
"""
|
||||||
|
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
|
||||||
|
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 weakref
|
import weakref
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
from allmydata.util.assertutil import precondition
|
from allmydata.util.assertutil import precondition
|
||||||
|
@ -14,7 +14,6 @@ if PY2:
|
|||||||
# Skip list() since it results in spurious test failures
|
# Skip list() since it results in spurious test failures
|
||||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, object, range, str, max, min # noqa: F401
|
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, object, range, str, max, min # noqa: F401
|
||||||
|
|
||||||
import six
|
|
||||||
import time
|
import time
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
@ -46,9 +45,6 @@ import allmydata.test.common_util as testutil
|
|||||||
from hypothesis import given
|
from hypothesis import given
|
||||||
from hypothesis.strategies import text
|
from hypothesis.strategies import text
|
||||||
|
|
||||||
if six.PY3:
|
|
||||||
long = int
|
|
||||||
|
|
||||||
|
|
||||||
@implementer(IConsumer)
|
@implementer(IConsumer)
|
||||||
class MemAccum(object):
|
class MemAccum(object):
|
||||||
|
@ -66,6 +66,7 @@ PORTED_MODULES = [
|
|||||||
"allmydata.mutable.retrieve",
|
"allmydata.mutable.retrieve",
|
||||||
"allmydata.mutable.servermap",
|
"allmydata.mutable.servermap",
|
||||||
"allmydata.node",
|
"allmydata.node",
|
||||||
|
"allmydata.nodemaker",
|
||||||
"allmydata.storage_client",
|
"allmydata.storage_client",
|
||||||
"allmydata.storage.common",
|
"allmydata.storage.common",
|
||||||
"allmydata.storage.crawler",
|
"allmydata.storage.crawler",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user