diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-01-05 14:48:10 -0800 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-02-08 12:29:33 -0800 |
commit | c9ae4f051e1d6d53d5a55b9b390ed668962c9aee (patch) | |
tree | 2566a0106df4af1b8f1b0aad4dec69ce19a86021 /framework/profile.py | |
parent | 86b933a4f8c58a60ee9c542d1db39550a643a016 (diff) |
python: use six unicode/bytes/str handling
This is not feature complete for python 3.x in and of itself, but it
gets started by using six functions rather than str and unicode.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'framework/profile.py')
-rw-r--r-- | framework/profile.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/framework/profile.py b/framework/profile.py index 94343dbc3..b7204ed97 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -34,6 +34,8 @@ import importlib import contextlib import itertools +import six + from framework import grouptools, exceptions, options from framework.dmesg import get_dmesg from framework.log import LogManager @@ -73,7 +75,7 @@ class TestDict(dict): # pylint: disable=too-few-public-methods """ # keys should be strings - if not isinstance(key, basestring): + if not isinstance(key, six.string_types): raise exceptions.PiglitFatalError( "TestDict keys must be strings, but was {}".format(type(key))) @@ -348,7 +350,7 @@ class TestProfile(object): ... g(['power', 'test'], 'powertest') """ - assert isinstance(group, basestring), type(group) + assert isinstance(group, six.string_types), type(group) def adder(args, name=None, **kwargs): """Helper function that actually adds the tests. @@ -374,10 +376,10 @@ class TestProfile(object): if isinstance(args, list): name = ' '.join(args) else: - assert isinstance(args, basestring) + assert isinstance(args, six.string_types) name = args - assert isinstance(name, basestring) + assert isinstance(name, six.string_types) lgroup = grouptools.join(group, name) self.test_list[lgroup] = test_class( |