summaryrefslogtreecommitdiff
path: root/py/genlast.py
diff options
context:
space:
mode:
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__':