summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-18 21:52:33 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:10:03 +0100
commite8cfab060f4ff3c4c16387871354d407910e87aa (patch)
tree59ae168cb8d2c7ef9fa2a1d18f42ea99c540d14c
parent25d4d8274bac696a484f83d7f3ada778cf95f4d0 (diff)
downloadopenembedded-core-contrib-e8cfab060f4ff3c4c16387871354d407910e87aa.tar.gz
openembedded-core-contrib-e8cfab060f4ff3c4c16387871354d407910e87aa.tar.bz2
openembedded-core-contrib-e8cfab060f4ff3c4c16387871354d407910e87aa.zip
scripts: Replace basestring -> str for python3
Python 3 doesn't have basestring type as all string are unicode strings. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
-rw-r--r--meta/files/ext-sdk-prepare.py2
-rw-r--r--scripts/lib/devtool/__init__.py2
-rw-r--r--scripts/lib/recipetool/create.py2
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py6
-rw-r--r--scripts/lib/scriptutils.py2
5 files changed, 7 insertions, 7 deletions
diff --git a/meta/files/ext-sdk-prepare.py b/meta/files/ext-sdk-prepare.py
index 605e2ebefa..bf0d03336b 100644
--- a/meta/files/ext-sdk-prepare.py
+++ b/meta/files/ext-sdk-prepare.py
@@ -8,7 +8,7 @@ import subprocess
def exec_watch(cmd, **options):
"""Run program with stdout shown on sys.stdout"""
- if isinstance(cmd, basestring) and not "shell" in options:
+ if isinstance(cmd, str) and not "shell" in options:
options["shell"] = True
process = subprocess.Popen(
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 506d95b0f7..6f5bb8dba0 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -59,7 +59,7 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
def exec_watch(cmd, **options):
"""Run program with stdout shown on sys.stdout"""
import bb
- if isinstance(cmd, basestring) and not "shell" in options:
+ if isinstance(cmd, str) and not "shell" in options:
options["shell"] = True
process = subprocess.Popen(
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())
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index aef19d3d73..bd082d8581 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -103,7 +103,7 @@ def fetch_uri(d, uri, destdir, srcrev=None):
return ret
def run_editor(fn):
- if isinstance(fn, basestring):
+ if isinstance(fn, str):
params = '"%s"' % fn
else:
params = ''