Trust hunspell to print missing dictionaries on stderr.

This commit is contained in:
Julien Palard 2019-11-14 23:30:52 +01:00
parent e3eeb9cc69
commit b3ec58b63d

View File

@ -260,12 +260,15 @@ def spell_check(
(tmpdir / po_file.name).write_text(
po_to_text(str(po_file), drop_capitalized)
)
output = subprocess.check_output(
["hunspell", "-d", language]
+ personal_dict_arg
+ ["-u3", str(tmpdir / po_file.name)],
universal_newlines=True,
)
try:
output = subprocess.check_output(
["hunspell", "-d", language]
+ personal_dict_arg
+ ["-u3", str(tmpdir / po_file.name)],
universal_newlines=True,
)
except subprocess.CalledProcessError:
return -1
for line in output.split("\n"):
match = regex.match(
r"(?P<path>.*):(?P<line>[0-9]+): Locate: (?P<error>.*) \| Try: .*$",