From e8cfab060f4ff3c4c16387871354d407910e87aa Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 18 May 2016 21:52:33 +0300 Subject: scripts: Replace basestring -> str for python3 Python 3 doesn't have basestring type as all string are unicode strings. Signed-off-by: Ed Bartosh --- scripts/lib/recipetool/create.py | 2 +- scripts/lib/recipetool/create_buildsys_python.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/lib/recipetool') diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 5a37d18209..e3e01e385a 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -167,7 +167,7 @@ class RecipeHandler(object): unmappedpc = [] pcdeps = list(set(pcdeps)) for pcdep in pcdeps: - if isinstance(pcdep, basestring): + if isinstance(pcdep, str): recipe = recipemap.get(pcdep, None) if recipe: deps.append(recipe) diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index cc3b5a45fd..5cbea2abba 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py @@ -245,7 +245,7 @@ class PythonRecipeHandler(RecipeHandler): if field not in self.bbvar_map: continue - if isinstance(values, basestring): + if isinstance(values, str): value = values else: value = ' '.join(str(v) for v in values if v) @@ -436,7 +436,7 @@ class PythonRecipeHandler(RecipeHandler): return value value = info[variable] - if isinstance(value, basestring): + if isinstance(value, str): new_value = replace_value(search, replace, value) if new_value is None: del info[variable] @@ -706,7 +706,7 @@ class LiteralAstTransform(ast.NodeTransformer): def has_non_literals(value): if isinstance(value, ast.AST): return True - elif isinstance(value, basestring): + elif isinstance(value, str): return False elif hasattr(value, 'values'): return any(has_non_literals(v) for v in value.values()) -- cgit 1.2.3-korg