summaryrefslogtreecommitdiff
path: root/tools/gcc.py
diff options
context:
space:
mode:
authorArdaFu <[email protected]>2018-11-07 13:40:41 +0800
committerArdaFu <[email protected]>2018-11-07 13:40:41 +0800
commite7ca31ccaa46fa30564b136dc33daa08d8397b2c (patch)
tree635905cfd3815d46d8c7a15527d4b85696d1f6f9 /tools/gcc.py
parent3a63c0af5698188d467ef3a2648921354920d9be (diff)
[tools] Modify building.py and gcc.py for work with Python 3.
Diffstat (limited to 'tools/gcc.py')
-rw-r--r--tools/gcc.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/gcc.py b/tools/gcc.py
index 8bc2dcf7a8..90e5a7dba8 100644
--- a/tools/gcc.py
+++ b/tools/gcc.py
@@ -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):