summaryrefslogtreecommitdiff
path: root/tools/iar.py
diff options
context:
space:
mode:
authorTangyuxin <[email protected]>2022-04-17 23:42:32 +0800
committerGitHub <[email protected]>2022-04-17 23:42:32 +0800
commitfcc4899b60844f30399da18408ee57fe6b130bfd (patch)
tree1596be5b51e156d7b44eff752697737f7b75171b /tools/iar.py
parent9fa8c78c9ac02cddd12fe053c5b504fa93ca86f5 (diff)
[tools] Add Python 3 compatibility patch (#5825)
Diffstat (limited to 'tools/iar.py')
-rw-r--r--tools/iar.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/iar.py b/tools/iar.py
index 6b31976d05..687b125174 100644
--- a/tools/iar.py
+++ b/tools/iar.py
@@ -190,7 +190,7 @@ def IARVersion():
return path
- path = IARPath();
+ path = IARPath()
if os.path.exists(path):
cmd = os.path.join(path, 'iccarm.exe')
@@ -200,7 +200,8 @@ def IARVersion():
child = subprocess.Popen([cmd, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate()
-
+ if not isinstance(stdout, str):
+ stdout = str(stdout, 'utf8') # Patch for Python 3
# example stdout: IAR ANSI C/C++ Compiler V8.20.1.14183/W32 for ARM
iar_version = re.search('[\d\.]+', stdout).group(0)
if GetOption('verbose'):