Blame SOURCES/0023-tests-Avoid-explicit-type-comparison-in-runner-scrip.patch

fc9b0e
From e5f91fcc3e6bd0a610e47e51891f4c1669d2f8b1 Mon Sep 17 00:00:00 2001
fc9b0e
Message-Id: <e5f91fcc3e6bd0a610e47e51891f4c1669d2f8b1.1566225007.git.aquini@redhat.com>
fc9b0e
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
From: David Gibson <david@gibson.dropbear.id.au>
fc9b0e
Date: Sat, 17 Aug 2019 20:59:47 +1000
fc9b0e
Subject: [RHEL7 PATCH 23/31] tests: Avoid explicit type() comparison in runner
fc9b0e
 script
fc9b0e
fc9b0e
Using isinstance() is the more modern idiom, and won't cause complications
fc9b0e
in porting to Python3.
fc9b0e
fc9b0e
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
fc9b0e
Signed-off-by: Eric B Munson <eric@munsonfam.org>
fc9b0e
Signed-off-by: Rafael Aquini <aquini@redhat.com>
fc9b0e
---
fc9b0e
 tests/run_tests.py | 2 +-
fc9b0e
 1 file changed, 1 insertion(+), 1 deletion(-)
fc9b0e
fc9b0e
diff --git a/tests/run_tests.py b/tests/run_tests.py
fc9b0e
index f812923..e2025fe 100755
fc9b0e
--- a/tests/run_tests.py
fc9b0e
+++ b/tests/run_tests.py
fc9b0e
@@ -309,7 +309,7 @@ def check_linkhuge_tests():
fc9b0e
 def print_cmd(pagesize, bits, cmd, env):
fc9b0e
     if env:
fc9b0e
         print(' '.join(['%s=%s' % (k, v) for k, v in env.items()]), end=" ")
fc9b0e
-    if type(cmd) != types.StringType:
fc9b0e
+    if not isinstance(cmd, str):
fc9b0e
         cmd = ' '.join(cmd)
fc9b0e
     print("%s (%s: %i):\t" % (cmd, pretty_page_size(pagesize), bits), end="")
fc9b0e
     sys.stdout.flush()
fc9b0e
-- 
fc9b0e
1.8.3.1
fc9b0e