Skip to content

Commit

Permalink
Fix None.find
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPotte committed Apr 4, 2020
1 parent 5e28544 commit 3bf99f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wiktionary/fr_wiktionary_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ def treat_page_by_name(page_name):
print(' 2 = ' + term)
template_page = get_content_from_page_name('Template:' + term, site,
allowed_namespaces=['Template:'])
if template_page.find('Catégorie:Modèles de domaine') != -1 or template_page.find(
'{{région|') != -1:
if template_page is not None and (template_page.find('Catégorie:Modèles de domaine') != -1 \
or template_page.find('{{région|') != -1):
if debug_level > 0:
print(' substitution par le modèle existant')
page_content = '{{' + term + page_content[end_position + 1 + len(raw_term):]
Expand Down

0 comments on commit 3bf99f7

Please sign in to comment.