]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: Replace basestring -> str for python3
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 18 May 2016 18:52:33 +0000 (21:52 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Jun 2016 07:10:03 +0000 (08:10 +0100)
Python 3 doesn't have basestring type as all string
are unicode strings.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
meta/files/ext-sdk-prepare.py
scripts/lib/devtool/__init__.py
scripts/lib/recipetool/create.py
scripts/lib/recipetool/create_buildsys_python.py
scripts/lib/scriptutils.py

index 605e2ebefa28ec9a4686441d5c4a744c0b9876fc..bf0d03336b4c1f6021b027a11fa1b034921a4eba 100644 (file)
@@ -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(
index 506d95b0f79cbd317781b68e6f4a85c92d470273..6f5bb8dba05e7fec3d0fe168f33eab9cdb7240bd 100644 (file)
@@ -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(
index 5a37d18209e9b2c256c16b62b3259eb13ff4293d..e3e01e385a9dcfb382ba3c7995b88b1dc4b8af54 100644 (file)
@@ -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)
index cc3b5a45fd98afccc841adfe1e9ca25c6ad8514d..5cbea2abbad1b3f9b322763eaa764dda019cbf0f 100644 (file)
@@ -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())
index aef19d3d73cc814b5beaaaf57710bde599f1941e..bd082d8581a62c3fa49689ded752c99f84575b5d 100644 (file)
@@ -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 = ''