* pygnulib/main.py (main) [import]: Match all characters until '#' or
end of line, whichever comes first.
2024-06-02 Collin Funk <collin.funk1@gmail.com>
+ gnulib-tool.py: Fix regular expression (regr. today).
+ * pygnulib/main.py (main) [import]: Match all characters until '#' or
+ end of line, whichever comes first.
+
gnulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found.
* pygnulib/main.py (main) [import]: Use a regular expression to match
the ACLOCAL_AMFLAGS Makefile.am variable. Properly handle the case where
if os.path.isfile(filepath):
with open(filepath, mode='r', newline='\n', encoding='utf-8') as file:
data = file.read()
- pattern = re.compile(r'^ACLOCAL_AMFLAGS[\t ]*=[\t ]*([^#]+?)$', re.MULTILINE)
+ pattern = re.compile(r'^ACLOCAL_AMFLAGS[\t ]*=[\t ]*(.+?)[\t ]*(?:#|$)', re.MULTILINE)
match = re.search(pattern, data)
if match:
aclocal_amflags = match.group(1).split()