diff options
| author | Meco Jianting Man <[email protected]> | 2021-04-10 14:00:43 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-10 14:00:43 +0800 |
| commit | b2f23f2a96a960db5464ee2a03cddda909b2c3a4 (patch) | |
| tree | 68630b709427eb3b4c50ef1660859f4d6dd83553 /tools/building.py | |
| parent | 342b0a3b1f72e874c8e033ffc267bc581f548054 (diff) | |
| parent | 4dc6d002167edcb482b64be9d343de8a167cc3be (diff) | |
Merge pull request #37 from RT-Thread/master
同步官方
Diffstat (limited to 'tools/building.py')
| -rw-r--r-- | tools/building.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/building.py b/tools/building.py index 00a9f04107..2498aa2304 100644 --- a/tools/building.py +++ b/tools/building.py @@ -85,7 +85,7 @@ class Win32Spawn: try: os.remove(f) except Exception as e: - print ('Error removing file: ' + e) + print('Error removing file: ' + e) return -1 return 0 @@ -106,8 +106,8 @@ class Win32Spawn: try: proc = subprocess.Popen(cmdline, env=_e, shell=False) except Exception as e: - print ('Error in calling command:' + cmdline.split(' ')[0]) - print ('Exception: ' + os.strerror(e.errno)) + print('Error in calling command:' + cmdline.split(' ')[0]) + print('Exception: ' + os.strerror(e.errno)) if (os.strerror(e.errno) == "No such file or directory"): print ("\nPlease check Toolchains PATH setting.\n") @@ -274,7 +274,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ os.environ['RTT_CC'] = rtconfig.CROSS_TOOL utils.ReloadModule(rtconfig) except KeyError: - print ('Unknow target: '+ tgt_name+'. Avaible targets: ' +', '.join(tgt_dict.keys())) + print('Unknow target: '+ tgt_name+'. Avaible targets: ' +', '.join(tgt_dict.keys())) sys.exit(1) # auto change the 'RTT_EXEC_PATH' when 'rtconfig.EXEC_PATH' get failed @@ -662,7 +662,7 @@ def DefineGroup(name, src, depend, **parameters): # check whether to clean up library if GetOption('cleanlib') and os.path.exists(os.path.join(group['path'], GroupLibFullName(name, Env))): if group['src'] != []: - print ('Remove library:'+ GroupLibFullName(name, Env)) + print('Remove library:'+ GroupLibFullName(name, Env)) fn = os.path.join(group['path'], GroupLibFullName(name, Env)) if os.path.exists(fn): os.unlink(fn) @@ -735,7 +735,7 @@ def BuildLibInstallAction(target, source, env): if Group['name'] == lib_name: lib_name = GroupLibFullName(Group['name'], env) dst_name = os.path.join(Group['path'], lib_name) - print ('Copy '+lib_name+' => ' +dst_name) + print('Copy '+lib_name+' => ' + dst_name) do_copy_file(lib_name, dst_name) break @@ -996,11 +996,11 @@ def GetVersion(): prepcessor.process_contents(contents) def_ns = prepcessor.cpp_namespace - version = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_VERSION'])) - subversion = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_SUBVERSION'])) + version = int([ch for ch in def_ns['RT_VERSION'] if ch in '0123456789.']) + subversion = int([ch for ch in def_ns['RT_SUBVERSION'] if ch in '0123456789.']) if 'RT_REVISION' in def_ns: - revision = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_REVISION'])) + revision = int([ch for ch in def_ns['RT_REVISION'] if ch in '0123456789.']) return '%d.%d.%d' % (version, subversion, revision) return '0.%d.%d' % (version, subversion) |
