MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / IARVersion

Function IARVersion

tools/targets/iar.py:192–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190 return path
191
192def IARVersion():
193 import subprocess
194 import re
195
196 path = IARPath()
197
198 if os.path.exists(path):
199 cmd = os.path.join(path, 'iccarm.exe')
200 else:
201 return "0.0"
202
203 child = subprocess.Popen([cmd, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
204 stdout, stderr = child.communicate()
205 if not isinstance(stdout, str):
206 stdout = str(stdout, 'utf8') # Patch for Python 3
207 # example stdout: IAR ANSI C/C++ Compiler V8.20.1.14183/W32 for ARM
208 iar_version = re.search(r'[\d\.]+', stdout).group(0)
209 return iar_version

Callers 1

GenTargetProjectFunction · 0.90

Calls 2

IARPathFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected