summaryrefslogtreecommitdiff
path: root/py/genlast.py
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-11-20 23:33:39 -0500
committerDan Halbert <halbert@halwitz.org>2020-11-20 23:33:39 -0500
commite4c66990e27779f43f4901d431b6c61f8da85f51 (patch)
tree02b96290a95fbde6925372cdcb53db6746a5347a /py/genlast.py
parent39e1f52e28c620db65d59f16a29d5476c4868901 (diff)
compiles
Diffstat (limited to 'py/genlast.py')
-rw-r--r--py/genlast.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/genlast.py b/py/genlast.py
index 1df2a2482..5b195d23e 100644
--- a/py/genlast.py
+++ b/py/genlast.py
@@ -47,7 +47,9 @@ def preprocess(command, output_dir, fn):
print(e, file=sys.stderr)
def maybe_preprocess(command, output_dir, fn):
- if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0:
+ # Preprocess the source file if it contains "MP_QSTR", "translate",
+ # or if it uses enum.h (which generates "MP_QSTR" strings.
+ if subprocess.call(["grep", "-lqE", r"(MP_QSTR|translate|enum\.h)", fn]) == 0:
preprocess(command, output_dir, fn)
if __name__ == '__main__':