Skip to content

Commit 9c3801b

Browse files
committed
Config - fix - use basetring to check if a target is string
1 parent 359d33c commit 9c3801b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/build_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_config(src_path, target, toolchain_name):
8888
config = Config(target, src_paths)
8989

9090
# If the 'target' argument is a string, convert it to a target instance
91-
if isinstance(target, str):
91+
if isinstance(target, basestring):
9292
try:
9393
target = TARGET_MAP[target]
9494
except KeyError:
@@ -149,7 +149,7 @@ def build_project(src_path, build_path, target, toolchain_name,
149149
config = config or Config(target, src_paths)
150150

151151
# If the 'target' argument is a string, convert it to a target instance
152-
if isinstance(target, str):
152+
if isinstance(target, basestring):
153153
try:
154154
target = TARGET_MAP[target]
155155
except KeyError:
@@ -286,7 +286,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
286286
config = Config(target, src_paths)
287287

288288
# If the 'target' argument is a string, convert it to a target instance
289-
if isinstance(target, str):
289+
if isinstance(target, basestring):
290290
try:
291291
target = TARGET_MAP[target]
292292
except KeyError:

tools/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __init__(self, target, top_level_dirs = []):
182182
self.lib_config_data = {}
183183
# Make sure that each config is processed only once
184184
self.processed_configs = {}
185-
self.target = target if isinstance(target, str) else target.name
185+
self.target = target if isinstance(target, basestring) else target.name
186186
self.target_labels = Target.get_target(self.target).get_labels()
187187
self.added_features = set()
188188
self.removed_features = set()

0 commit comments

Comments
 (0)