Skip to content

Commit

Permalink
Fix 0 like None
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertbossot committed Dec 27, 2023
1 parent bf0b87f commit f2ddb95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/page_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def replace_parameter_if_double(page_content, p, v):
print('\nreplace_parameter_if_double()')

regex = r'\| *' + p + r' *='
if '}}' not in page_content or not re.search(regex, page_content):
if '}}' not in page_content or re.search(regex, page_content) is None:
return ''

if re.search(regex, page_content).start() > page_content.find('}}'):
Expand Down
2 changes: 1 addition & 1 deletion src/wiktionary/fr_wiktionary_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def treat_page(page):
else:
line_end = page_content2[:page_content2.find('\n')]
new_line_end = replace_parameter_if_double(line_end, 'lang', language_code)
if line_end != new_line_end:
if new_line_end != '' and line_end != new_line_end:
# Fix doubles
new_page_content2 = page_content2.replace(line_end, new_line_end)
page_content = page_content.replace(page_content2, new_page_content2)
Expand Down

0 comments on commit f2ddb95

Please sign in to comment.