[tools] Python 3 compatibility support

This commit is contained in:
tangyuxin
2021-04-05 11:59:54 +08:00
parent 1e4a463f36
commit 510955ba42
12 changed files with 135 additions and 56 deletions

View File

@@ -212,7 +212,7 @@ def HandleToolOption(tools, env, project, reset):
linker_nostart_option = option
elif option.get('id').find('linker.libs') != -1:
linker_libs_option = option
elif option.get('id').find('linker.paths') != -1 and env.has_key('LIBPATH'):
elif option.get('id').find('linker.paths') != -1 and 'LIBPATH' in env:
linker_paths_option = option
elif option.get('id').find('linker.usenewlibnano') != -1:
linker_newlib_nano_option = option
@@ -317,7 +317,7 @@ def HandleToolOption(tools, env, project, reset):
option.remove(item)
# add new libs
if env.has_key('LIBS'):
if 'LIBS' in env:
for lib in env['LIBS']:
formatedLib = ConverToRttEclipseLibFormat(lib)
SubElement(option, 'listOptionValue', {