Commit 47400170 authored by Michal Čihař's avatar Michal Čihař

Remove only if it exists

parent 867d89e6
......@@ -206,8 +206,12 @@ def check_format_strings(source, target, regex):
return False
src_matches = set([x[0] for x in regex.findall(source)])
tgt_matches = set([x[0] for x in regex.findall(target)])
src_matches.remove('%')
tgt_matches.remove('%')
# We ignore %% as this is really not relevant. However it needs
# to be matched to prevent handling %%s as %s.
if '%' in src_matches:
src_matches.remove('%')
if '%' in tgt_matches:
tgt_matches.remove('%')
if src_matches != tgt_matches:
return True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment