mirror of https://github.com/ARMmbed/mbed-os.git
Fix Traceback in CMSIS export.
The traceback was caused when a file without a parent directory (which is implicitly ".") is added to the resources object. The code assumed that all files within the resources object would have a parent directory. This commit changes the check to account for files that are in the root directory of a project and have no preceding `./`pull/4209/head
parent
18134bf8b3
commit
1d68057a7a
|
@ -121,7 +121,7 @@ class CMSIS(Exporter):
|
|||
new_srcs = []
|
||||
for f in list(files):
|
||||
spl = f.name.split(sep)
|
||||
if len(spl)==2:
|
||||
if len(spl) <= 2:
|
||||
file_element = Element('file',
|
||||
attrib={
|
||||
'category':f.type,
|
||||
|
@ -148,8 +148,4 @@ class CMSIS(Exporter):
|
|||
'device': DeviceCMSIS(self.target),
|
||||
'date': ''
|
||||
}
|
||||
# TODO: find how to keep prettyxml from adding xml version to this blob
|
||||
#dom = parseString(ctx['project_files'])
|
||||
#ctx['project_files'] = dom.toprettyxml(indent="\t")
|
||||
|
||||
self.gen_file('cmsis/cpdsc.tmpl', ctx, 'project.cpdsc')
|
||||
|
|
Loading…
Reference in New Issue