mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
Port eliotutil and tests to Python 3.
This commit is contained in:
parent
7458ea6345
commit
4a587836a5
0
newsfragments/3560.minor
Normal file
0
newsfragments/3560.minor
Normal file
@ -34,10 +34,6 @@ python.pkgs.buildPythonPackage rec {
|
|||||||
rm src/allmydata/test/cli/test_create.py
|
rm src/allmydata/test/cli/test_create.py
|
||||||
rm src/allmydata/test/test_client.py
|
rm src/allmydata/test/test_client.py
|
||||||
rm src/allmydata/test/test_runner.py
|
rm src/allmydata/test/test_runner.py
|
||||||
|
|
||||||
# Some eliot code changes behavior based on whether stdout is a tty or not
|
|
||||||
# and fails when it is not.
|
|
||||||
rm src/allmydata/test/test_eliotutil.py
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Tests for ``allmydata.test.eliotutil``.
|
Tests for ``allmydata.util.eliotutil``.
|
||||||
|
|
||||||
|
Ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import (
|
from __future__ import (
|
||||||
@ -9,6 +11,10 @@ from __future__ import (
|
|||||||
division,
|
division,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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 sys import stdout
|
from sys import stdout
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ PORTED_MODULES = [
|
|||||||
"allmydata.util.connection_status",
|
"allmydata.util.connection_status",
|
||||||
"allmydata.util.deferredutil",
|
"allmydata.util.deferredutil",
|
||||||
"allmydata.util.dictutil",
|
"allmydata.util.dictutil",
|
||||||
|
"allmydata.util.eliotutil",
|
||||||
"allmydata.util.encodingutil",
|
"allmydata.util.encodingutil",
|
||||||
"allmydata.util.fileutil",
|
"allmydata.util.fileutil",
|
||||||
"allmydata.util.gcutil",
|
"allmydata.util.gcutil",
|
||||||
@ -140,6 +141,7 @@ PORTED_TEST_MODULES = [
|
|||||||
"allmydata.test.test_dictutil",
|
"allmydata.test.test_dictutil",
|
||||||
"allmydata.test.test_dirnode",
|
"allmydata.test.test_dirnode",
|
||||||
"allmydata.test.test_download",
|
"allmydata.test.test_download",
|
||||||
|
"allmydata.test.test_eliotutil",
|
||||||
"allmydata.test.test_encode",
|
"allmydata.test.test_encode",
|
||||||
"allmydata.test.test_encodingutil",
|
"allmydata.test.test_encodingutil",
|
||||||
"allmydata.test.test_filenode",
|
"allmydata.test.test_filenode",
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
"""
|
"""
|
||||||
Tools aimed at the interaction between Tahoe-LAFS implementation and Eliot.
|
Tools aimed at the interaction between Tahoe-LAFS implementation and Eliot.
|
||||||
|
|
||||||
|
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__ import (
|
from __future__ import (
|
||||||
unicode_literals,
|
unicode_literals,
|
||||||
@ -18,6 +24,11 @@ __all__ = [
|
|||||||
"validateSetMembership",
|
"validateSetMembership",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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 six import ensure_text
|
||||||
|
|
||||||
from sys import (
|
from sys import (
|
||||||
stdout,
|
stdout,
|
||||||
)
|
)
|
||||||
@ -228,7 +239,7 @@ def _stdlib_logging_to_eliot_configuration(stdlib_logger, eliot_logger=None):
|
|||||||
|
|
||||||
class _DestinationParser(object):
|
class _DestinationParser(object):
|
||||||
def parse(self, description):
|
def parse(self, description):
|
||||||
description = description.decode(u"ascii")
|
description = ensure_text(description)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
kind, args = description.split(u":", 1)
|
kind, args = description.split(u":", 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user