issue5230: fixed resource warnings in language

This commit is contained in:
Leander Fiedler 2020-04-06 18:54:32 +02:00 committed by lfiedler
parent 493c77462a
commit 1cd975d4a5
2 changed files with 2 additions and 4 deletions

View File

@ -903,9 +903,8 @@ class Language(object):
serializers["tokenizer"] = lambda p: self.tokenizer.to_disk(
p, exclude=["vocab"]
)
serializers["meta.json"] = lambda p: p.open("w").write(
srsly.json_dumps(self.meta)
)
serializers["meta.json"] = lambda p: srsly.write_json(p, self.meta)
for name, proc in self.pipeline:
if not hasattr(proc, "name"):
continue

View File

@ -11,7 +11,6 @@ from spacy.pipeline import Pipe
from spacy.tests.util import make_tempdir
@pytest.mark.xfail
def test_language_to_disk_resource_warning():
nlp = Language()
with make_tempdir() as d: