Patchwork [2,of,2] run-tests: convert hghave output to text

login
register
mail settings
Submitter timeless@mozdev.org
Date March 30, 2016, 8:20 a.m.
Message ID <bc149b7f13ad842e7945.1459326034@waste.org>
Download mbox | patch
Permalink /patch/14172/
State Superseded
Headers show

Comments

timeless@mozdev.org - March 30, 2016, 8:20 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459324954 0
#      Wed Mar 30 08:02:34 2016 +0000
# Node ID bc149b7f13ad842e7945704a6b27467a1481dab4
# Parent  d5a110d3c09a84a41c977e33f07eaa0f14003dfd
run-tests: convert hghave output to text

Before this, Python3 generated:
b'skipped: unknown feature: not-py3k\n'
Yuya Nishihara - March 31, 2016, 1:27 p.m.
On Wed, 30 Mar 2016 03:20:34 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459324954 0
> #      Wed Mar 30 08:02:34 2016 +0000
> # Node ID bc149b7f13ad842e7945704a6b27467a1481dab4
> # Parent  d5a110d3c09a84a41c977e33f07eaa0f14003dfd
> run-tests: convert hghave output to text
> 
> Before this, Python3 generated:
> b'skipped: unknown feature: not-py3k\n'
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1010,7 +1010,7 @@
>          if wifexited(ret):
>              ret = os.WEXITSTATUS(ret)
>          if ret == 2:
> -            print(stdout)
> +            print(stdout.decode('utf-8'))

Queued these, thanks.

As the output never be non-ascii, printing a unicode object on Python 2
should be safe.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1010,7 +1010,7 @@ 
         if wifexited(ret):
             ret = os.WEXITSTATUS(ret)
         if ret == 2:
-            print(stdout)
+            print(stdout.decode('utf-8'))
             sys.exit(1)
 
         if ret != 0: