Skip to content

Commit 6a32567

Browse files
committed
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 `./`
1 parent 7d65b0f commit 6a32567

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/export/cmsis/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def group_project_files(self, sources, root_element):
121121
new_srcs = []
122122
for f in list(files):
123123
spl = f.name.split(sep)
124-
if len(spl)==2:
124+
if len(spl) <= 2:
125125
file_element = Element('file',
126126
attrib={
127127
'category':f.type,
@@ -148,8 +148,4 @@ def generate(self):
148148
'device': DeviceCMSIS(self.target),
149149
'date': ''
150150
}
151-
# TODO: find how to keep prettyxml from adding xml version to this blob
152-
#dom = parseString(ctx['project_files'])
153-
#ctx['project_files'] = dom.toprettyxml(indent="\t")
154-
155151
self.gen_file('cmsis/cpdsc.tmpl', ctx, 'project.cpdsc')

0 commit comments

Comments
 (0)