correct merge resolution

This commit is contained in:
meejah 2020-12-14 13:53:56 -07:00
parent bf799c1cf8
commit 38968b4034
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,6 @@ def run_cli_bytes(verb, *args, **kwargs):
nodeargs=nodeargs, nodeargs=nodeargs,
) )
argv = nodeargs + [verb] + list(args) argv = nodeargs + [verb] + list(args)
stdin = kwargs.get("stdin", "")
if encoding is None: if encoding is None:
# The original behavior, the Python 2 behavior, is to accept either # The original behavior, the Python 2 behavior, is to accept either
# bytes or unicode and try to automatically encode or decode as # bytes or unicode and try to automatically encode or decode as
@ -91,6 +90,7 @@ def run_cli_bytes(verb, *args, **kwargs):
# away from this behavior. # away from this behavior.
stdout = StringIO() stdout = StringIO()
stderr = StringIO() stderr = StringIO()
stdin = StringIO(kwargs.get("stdin", ""))
else: else:
# The new behavior, the Python 3 behavior, is to accept unicode and # The new behavior, the Python 3 behavior, is to accept unicode and
# encode it using a specific encoding. For older versions of Python # encode it using a specific encoding. For older versions of Python
@ -99,6 +99,7 @@ def run_cli_bytes(verb, *args, **kwargs):
# encodings to exercise different behaviors. # encodings to exercise different behaviors.
stdout = TextIOWrapper(BytesIO(), encoding) stdout = TextIOWrapper(BytesIO(), encoding)
stderr = TextIOWrapper(BytesIO(), encoding) stderr = TextIOWrapper(BytesIO(), encoding)
stdin = TextIOWrapper(BytesIO(kwargs.get("stdin", b""), encoding)
d = defer.succeed(argv) d = defer.succeed(argv)
d.addCallback(runner.parse_or_exit_with_explanation, stdout=stdout, stderr=stderr, stdin=stdin) d.addCallback(runner.parse_or_exit_with_explanation, stdout=stdout, stderr=stderr, stdin=stdin)
d.addCallback( d.addCallback(