mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-20 05:25:04 +08:00
[tools] Modify building.py and gcc.py for work with Python 3.
This commit is contained in:
@@ -55,14 +55,14 @@ def GetNewLibVersion(rtconfig):
|
||||
for line in f:
|
||||
if line.find('_NEWLIB_VERSION') != -1 and line.find('"') != -1:
|
||||
version = re.search(r'\"([^"]+)\"', line).groups()[0]
|
||||
f.close()
|
||||
f.close()
|
||||
elif CheckHeader(rtconfig, 'newlib.h'): # get version from newlib.h
|
||||
f = open(os.path.join(root, 'include', 'newlib.h'), 'r')
|
||||
if f:
|
||||
for line in f:
|
||||
if line.find('_NEWLIB_VERSION') != -1 and line.find('"') != -1:
|
||||
version = re.search(r'\"([^"]+)\"', line).groups()[0]
|
||||
f.close()
|
||||
f.close()
|
||||
return version
|
||||
|
||||
def GCCResult(rtconfig, str):
|
||||
@@ -148,7 +148,6 @@ def GCCResult(rtconfig, str):
|
||||
result += '#define LIBC_POSIX_THREADS 1\n'
|
||||
|
||||
os.remove('__tmp.c')
|
||||
f.close()
|
||||
return result
|
||||
|
||||
def GenerateGCCConfig(rtconfig):
|
||||
|
Reference in New Issue
Block a user