commit:     9f8c659431bbe554bbe96cb074c9e3fe957b72ce
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  4 14:56:45 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Mar  4 14:56:45 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f8c6594

dev-util/meson: backport Python 3.5 tests fix

Package-Manager: Portage-2.3.59_p2, Repoman-2.3.12_p67
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../meson/files/meson-0.49-python3.5-tests.patch   | 34 ++++++++++++++++++++++
 dev-util/meson/meson-0.49.2.ebuild                 |  9 +++---
 dev-util/meson/meson-9999.ebuild                   |  5 ----
 3 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/dev-util/meson/files/meson-0.49-python3.5-tests.patch 
b/dev-util/meson/files/meson-0.49-python3.5-tests.patch
new file mode 100644
index 00000000000..640348b2bc2
--- /dev/null
+++ b/dev-util/meson/files/meson-0.49-python3.5-tests.patch
@@ -0,0 +1,34 @@
+From 65192af2ff62a032a3f19d065c95e12b83aae709 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <[email protected]>
+Date: Fri, 11 Jan 2019 18:03:15 +0000
+Subject: [PATCH] run_unittests: Use Python 3.5-compatible subprocess
+ invocation
+
+subprocess.run() didn't get the encoding parameter until 3.6.
+
+Signed-off-by: Simon McVittie <[email protected]>
+---
+ run_unittests.py | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/run_unittests.py b/run_unittests.py
+index 342ad883..e1246140 100755
+--- a/run_unittests.py
++++ b/run_unittests.py
+@@ -5029,10 +5029,9 @@ class NativeFileTests(BasePlatformTests):
+                     ret = subprocess.run(
+                         ["{}"] + extra_args,
+                         stdout=subprocess.PIPE,
+-                        stderr=subprocess.PIPE,
+-                        encoding='utf-8')
+-                    print(ret.stdout)
+-                    print(ret.stderr, file=sys.stderr)
++                        stderr=subprocess.PIPE)
++                    print(ret.stdout.decode('utf-8'))
++                    print(ret.stderr.decode('utf-8'), file=sys.stderr)
+                     sys.exit(ret.returncode)
+ 
+                 if __name__ == '__main__':
+-- 
+2.21.0
+

diff --git a/dev-util/meson/meson-0.49.2.ebuild 
b/dev-util/meson/meson-0.49.2.ebuild
index af2f0b75de8..09b40845cc6 100644
--- a/dev-util/meson/meson-0.49.2.ebuild
+++ b/dev-util/meson/meson-0.49.2.ebuild
@@ -33,6 +33,10 @@ DEPEND="${RDEPEND}
        )
 "
 
+PATCHES=(
+       "${FILESDIR}/meson-0.49-python3.5-tests.patch"
+)
+
 python_prepare_all() {
        # ASAN and sandbox both want control over LD_PRELOAD
        # https://bugs.gentoo.org/673016
@@ -51,11 +55,6 @@ src_test() {
 }
 
 python_test() {
-       if [[ ${EPYTHON} == python3.5 ]]; then
-               ewarn "Skipping tests with ${EPYTHON}"
-               return 0
-       fi
-
        (
                # test_meson_installed
                unset PYTHONDONTWRITEBYTECODE

diff --git a/dev-util/meson/meson-9999.ebuild b/dev-util/meson/meson-9999.ebuild
index af2f0b75de8..89b176910cb 100644
--- a/dev-util/meson/meson-9999.ebuild
+++ b/dev-util/meson/meson-9999.ebuild
@@ -51,11 +51,6 @@ src_test() {
 }
 
 python_test() {
-       if [[ ${EPYTHON} == python3.5 ]]; then
-               ewarn "Skipping tests with ${EPYTHON}"
-               return 0
-       fi
-
        (
                # test_meson_installed
                unset PYTHONDONTWRITEBYTECODE

Reply via email to