summaryrefslogtreecommitdiffstatshomepage
path: root/py/makeqstrdefs.py
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-08-26 11:23:10 +0200
committerDamien George <damien@micropython.org>2020-10-29 15:26:35 +1100
commit1b723937e3fe4012ac878ded833ff6a39455e0b8 (patch)
tree1b05abfb400a68c8e284e6a30b4a94771489c7ce /py/makeqstrdefs.py
parent6f34800884f0a9a0c7116a7c5b94c6db38c4b417 (diff)
downloadmicropython-1b723937e3fe4012ac878ded833ff6a39455e0b8.tar.gz
micropython-1b723937e3fe4012ac878ded833ff6a39455e0b8.zip
py/makeqstrdefs.py: Fix beaviour when scanning non-C preprocessed files.
When process_file() is passed a preprocessed C++ file for instance it won't find any lines containing .c files and the last_fname variable remains None, so handle that gracefully.
Diffstat (limited to 'py/makeqstrdefs.py')
-rw-r--r--py/makeqstrdefs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py
index 9449a46ee9..47afe0adb9 100644
--- a/py/makeqstrdefs.py
+++ b/py/makeqstrdefs.py
@@ -58,7 +58,8 @@ def process_file(f):
elif args.mode == _MODE_COMPRESS:
output.append(match)
- write_out(last_fname, output)
+ if last_fname:
+ write_out(last_fname, output)
return ""