mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 00:49:33 +02:00
scripts: Replace basestring -> str for python3
Python 3 doesn't have basestring type as all string are unicode strings. (From OE-Core rev: e8cfab060f4ff3c4c16387871354d407910e87aa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7eab022d4b
commit
ed7abe6b9a
@@ -8,7 +8,7 @@ import subprocess
|
|||||||
|
|
||||||
def exec_watch(cmd, **options):
|
def exec_watch(cmd, **options):
|
||||||
"""Run program with stdout shown on sys.stdout"""
|
"""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
|
options["shell"] = True
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
|
|||||||
def exec_watch(cmd, **options):
|
def exec_watch(cmd, **options):
|
||||||
"""Run program with stdout shown on sys.stdout"""
|
"""Run program with stdout shown on sys.stdout"""
|
||||||
import bb
|
import bb
|
||||||
if isinstance(cmd, basestring) and not "shell" in options:
|
if isinstance(cmd, str) and not "shell" in options:
|
||||||
options["shell"] = True
|
options["shell"] = True
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class RecipeHandler(object):
|
|||||||
unmappedpc = []
|
unmappedpc = []
|
||||||
pcdeps = list(set(pcdeps))
|
pcdeps = list(set(pcdeps))
|
||||||
for pcdep in pcdeps:
|
for pcdep in pcdeps:
|
||||||
if isinstance(pcdep, basestring):
|
if isinstance(pcdep, str):
|
||||||
recipe = recipemap.get(pcdep, None)
|
recipe = recipemap.get(pcdep, None)
|
||||||
if recipe:
|
if recipe:
|
||||||
deps.append(recipe)
|
deps.append(recipe)
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class PythonRecipeHandler(RecipeHandler):
|
|||||||
if field not in self.bbvar_map:
|
if field not in self.bbvar_map:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(values, basestring):
|
if isinstance(values, str):
|
||||||
value = values
|
value = values
|
||||||
else:
|
else:
|
||||||
value = ' '.join(str(v) for v in values if v)
|
value = ' '.join(str(v) for v in values if v)
|
||||||
@@ -436,7 +436,7 @@ class PythonRecipeHandler(RecipeHandler):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
value = info[variable]
|
value = info[variable]
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, str):
|
||||||
new_value = replace_value(search, replace, value)
|
new_value = replace_value(search, replace, value)
|
||||||
if new_value is None:
|
if new_value is None:
|
||||||
del info[variable]
|
del info[variable]
|
||||||
@@ -706,7 +706,7 @@ class LiteralAstTransform(ast.NodeTransformer):
|
|||||||
def has_non_literals(value):
|
def has_non_literals(value):
|
||||||
if isinstance(value, ast.AST):
|
if isinstance(value, ast.AST):
|
||||||
return True
|
return True
|
||||||
elif isinstance(value, basestring):
|
elif isinstance(value, str):
|
||||||
return False
|
return False
|
||||||
elif hasattr(value, 'values'):
|
elif hasattr(value, 'values'):
|
||||||
return any(has_non_literals(v) for v in value.values())
|
return any(has_non_literals(v) for v in value.values())
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ def fetch_uri(d, uri, destdir, srcrev=None):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def run_editor(fn):
|
def run_editor(fn):
|
||||||
if isinstance(fn, basestring):
|
if isinstance(fn, str):
|
||||||
params = '"%s"' % fn
|
params = '"%s"' % fn
|
||||||
else:
|
else:
|
||||||
params = ''
|
params = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user