Python2+3: The rest of mbed compile

pull/5848/head
Jimmy Brisson 2018-01-12 11:41:13 -06:00
parent 380ecb1b0e
commit 10a91216f5
2 changed files with 16 additions and 16 deletions

View File

@ -525,7 +525,7 @@ class MemapParser(object):
self.compute_report()
try:
if file_output:
file_desc = open(file_output, 'wb')
file_desc = open(file_output, 'w')
else:
file_desc = stdout
except IOError as error:
@ -559,24 +559,24 @@ class MemapParser(object):
Positional arguments:
file_desc - the file to write out the final report to
"""
csv_writer = csv.writer(file_desc, delimiter=',',
quoting=csv.QUOTE_MINIMAL)
writer = csv.writer(file_desc, delimiter=',',
quoting=csv.QUOTE_MINIMAL)
csv_module_section = []
csv_sizes = []
module_section = []
sizes = []
for i in sorted(self.short_modules):
for k in self.print_sections:
csv_module_section += [i+k]
csv_sizes += [self.short_modules[i][k]]
module_section.append((i + k))
sizes += [self.short_modules[i][k]]
csv_module_section += ['static_ram']
csv_sizes += [self.mem_summary['static_ram']]
module_section.append('static_ram')
sizes.append(self.mem_summary['static_ram'])
csv_module_section += ['total_flash']
csv_sizes += [self.mem_summary['total_flash']]
module_section.append('total_flash')
sizes.append(self.mem_summary['total_flash'])
csv_writer.writerow(csv_module_section)
csv_writer.writerow(csv_sizes)
writer.writerow(module_section)
writer.writerow(sizes)
return None
def generate_table(self, file_desc):

View File

@ -221,13 +221,13 @@ class Resources:
"""
count = 0
dupe_dict, dupe_headers = self._collect_duplicates(dict(), dict())
for objname, filenames in dupe_dict.iteritems():
for objname, filenames in dupe_dict.items():
if len(filenames) > 1:
count+=1
toolchain.tool_error(
"Object file %s.o is not unique! It could be made from: %s"\
% (objname, " ".join(filenames)))
for headername, locations in dupe_headers.iteritems():
for headername, locations in dupe_headers.items():
if len(locations) > 1:
count+=1
toolchain.tool_error(
@ -847,7 +847,7 @@ class mbedToolchain:
# ARM, GCC, IAR cross compatible
def get_link_file(self, cmd):
link_file = join(self.build_dir, ".link_files.txt")
with open(link_file, "wb") as f:
with open(link_file, "w") as f:
cmd_list = []
for c in cmd:
if c: