From fcd6b38bab8517d83e1ed48eef1bca9a9a190f57 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 20 May 2016 11:57:44 +0100 Subject: 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 --- scripts/oe-selftest | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/oe-selftest') 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: -- cgit 1.2.3-korg