Skip to content

Commit

Permalink
Merge pull request #524 from xxyzz/check_json
Browse files Browse the repository at this point in the history
Fix `NameError` exception in `check_tags()`
  • Loading branch information
xxyzz authored Feb 28, 2024
2 parents bd347c0 + 42953d1 commit e62da6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wiktextract/wiktionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def check_tags(
item: dict
) -> None:
assert isinstance(item, dict)
tags = dt.get("tags")
tags = item.get("tags")
if tags is None:
return
if not isinstance(tags, (list, tuple)):
Expand All @@ -211,7 +211,9 @@ def check_tags(
# XXX enable the following later (currently too many bogus tags in
# non-English editions). Tag values should be standardized across
# editions, except for uppercase tags (e.g., regional variants).
if wtp.lang_code in ("en",): # Check edition
if wxr.wtp.lang_code in ("en",): # Check edition
from .tags import valid_tags

if tag not in valid_tags:
check_error(wxr, dt, word, lang, pos,
"invalid tag {} not in valid_tags (or "
Expand Down

0 comments on commit e62da6b

Please sign in to comment.