From 1fc840ffc0267ecf3a15c4a59ab44869ef1d6339 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 9 May 2013 16:31:22 +0000 Subject: meta: python3 megapatch This needs splutting into smaller units, WIP atm. (From OE-Core rev: 21529228a7dca96a6a1b44ed9380c523efdeeb3e) 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 f621fd7e4e..6422505d8f 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 @@ -211,7 +213,7 @@ def get_tests_from_module(tmod): try: import importlib modlib = importlib.import_module(tmod) - for mod in vars(modlib).values(): + for mod in list(vars(modlib).values()): if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest: for test in dir(mod): if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'): @@ -415,7 +417,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() @@ -492,7 +494,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 v1.2.3-54-g00ecf