summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-07 13:40:07 +0200
committerBruno Haible <bruno@clisp.org>2022-08-07 23:04:09 +0200
commit9d722ddced2e46a06255be8eb24a54015f611af7 (patch)
tree3d81da7902564dfd37ca9d879a17b2f686be0c90 /pygnulib
parent54bf87fe01941049356177a1902bdf1a3eb49f7f (diff)
downloadgnulib-9d722ddced2e46a06255be8eb24a54015f611af7.tar.gz
gnulib-tool.py: Make regex uses more straightforward.
* pygnulib/constants.py: Don't use the "minimal matching" *? construct when it makes no difference (because we're matching a single line only and flag re.M is not specified). * pygnulib/GLModuleSystem.py: Likewise.
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLModuleSystem.py2
-rw-r--r--pygnulib/constants.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index afc7a472cf..e1b62ec56c 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -280,7 +280,7 @@ Include:|Link:|License:|Maintainer:)'
'''GLModule.getName() -> str
Return the name of the module.'''
- pattern = re.compile(joinpath('modules', '(.*?)$'))
+ pattern = re.compile(joinpath('modules', '(.*)$'))
result = pattern.findall(self.module)[0]
return result
diff --git a/pygnulib/constants.py b/pygnulib/constants.py
index 46c0cbc152..ba0ebc9942 100644
--- a/pygnulib/constants.py
+++ b/pygnulib/constants.py
@@ -412,7 +412,7 @@ def filter_filelist(separator, filelist,
listing = list()
for filename in filelist:
if filename.startswith(prefix) and filename.endswith(suffix):
- pattern = re.compile('^%s(.*?)%s$'
+ pattern = re.compile('^%s(.*)%s$'
% (removed_prefix, removed_suffix))
result = pattern.sub('%s\\1%s'
% (added_prefix, added_suffix), filename)