Add additional safety check

This commit is contained in:
Kiril Kovachev 2023-09-03 23:57:10 +01:00
parent 979698bad9
commit 140aa5005a

View File

@ -4,6 +4,9 @@ import mwparserfromhell
import sys import sys
def fix_inflection(template: mwparserfromhell.wikicode.Template): def fix_inflection(template: mwparserfromhell.wikicode.Template):
if template.name not in ("inflection of", "infl of"):
print("Somehow encountered invalid template:", template.name)
for param in template.params: for param in template.params:
param: mwparserfromhell.nodes.extras.Parameter param: mwparserfromhell.nodes.extras.Parameter
if param.value == "sbjv": if param.value == "sbjv":