summaryrefslogtreecommitdiff
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:57:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:10:04 +0100
commitfcd6b38bab8517d83e1ed48eef1bca9a9a190f57 (patch)
tree74b1ae041ac6fbc838cc2b3a44953ed3e99360b9 /scripts/oe-selftest
parentdad9617809c60ec5f11d4780b0afa1cffa1efed5 (diff)
downloadopenembedded-core-fcd6b38bab8517d83e1ed48eef1bca9a9a190f57.tar.gz
openembedded-core-fcd6b38bab8517d83e1ed48eef1bca9a9a190f57.tar.bz2
openembedded-core-fcd6b38bab8517d83e1ed48eef1bca9a9a190f57.zip
classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index db132fdf9f..b1ecf7f322 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2013 Intel Corporation
#
@@ -34,6 +34,8 @@ import subprocess
import time as t
import re
import fnmatch
+import collections
+import imp
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
import scriptpath
@@ -414,7 +416,7 @@ def coverage_report():
# Coverage under version 4 uses coverage.coverage
from coverage import coverage as Coverage
- import cStringIO as StringIO
+ import io as StringIO
from coverage.misc import CoverageException
cov_output = StringIO.StringIO()
@@ -442,7 +444,7 @@ def main():
bbpath = get_bb_var('BBPATH').split(':')
layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)]
sys.path.extend(layer_libdirs)
- reload(oeqa.selftest)
+ imp.reload(oeqa.selftest)
if args.run_tests_by and len(args.run_tests_by) >= 2:
valid_options = ['name', 'class', 'module', 'id', 'tag']
@@ -491,7 +493,7 @@ def main():
if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
print(" --", v)
for method in dir(t):
- if method.startswith("test_") and callable(vars(t)[method]):
+ if method.startswith("test_") and isinstance(vars(t)[method], collections.Callable):
print(" -- --", method)
except (AttributeError, ImportError) as e: