diff --git a/src/allmydata/test/test_pipeline.py b/src/allmydata/test/test_pipeline.py index b5c0f535a..ab7059521 100644 --- a/src/allmydata/test/test_pipeline.py +++ b/src/allmydata/test/test_pipeline.py @@ -3,6 +3,14 @@ Tests for allmydata.util.pipeline. 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 builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, int, list, object, range, str, max, min # noqa: F401 import gc diff --git a/src/allmydata/util/_python3.py b/src/allmydata/util/_python3.py index 92ad34174..72e56581b 100644 --- a/src/allmydata/util/_python3.py +++ b/src/allmydata/util/_python3.py @@ -23,6 +23,7 @@ PORTED_MODULES = [ "allmydata.util.mathutil", "allmydata.util.namespace", "allmydata.util.observer", + "allmydata.util.pipeline", "allmydata.util.pollmixin", "allmydata.util._python3", ] @@ -33,6 +34,7 @@ PORTED_TEST_MODULES = [ "allmydata.test.test_deferredutil", "allmydata.test.test_humanreadable", "allmydata.test.test_observer", + "allmydata.test.test_pipeline", "allmydata.test.test_python3", ] diff --git a/src/allmydata/util/pipeline.py b/src/allmydata/util/pipeline.py index 285a06b98..df80e2c6c 100644 --- a/src/allmydata/util/pipeline.py +++ b/src/allmydata/util/pipeline.py @@ -1,9 +1,24 @@ +""" +A pipeline of Deferreds. + +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 builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, int, list, object, range, str, max, min # noqa: F401 from twisted.internet import defer from twisted.python.failure import Failure from twisted.python import log from allmydata.util.assertutil import precondition + class PipelineError(Exception): """One of the pipelined messages returned an error. The received Failure object is stored in my .error attribute."""