From f758804401e288ee93561073ecee81f729a2b7a9 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 3 Oct 2020 11:41:28 +0200 Subject: [PATCH] Save one line of code --- spacy/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index c43943ef7..4d68e829c 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -1065,8 +1065,7 @@ def import_file(name: str, loc: Union[str, Path]) -> ModuleType: loc (str / Path): Path to the file. RETURNS: The loaded module. """ - loc = str(loc) - spec = importlib.util.spec_from_file_location(name, loc) + spec = importlib.util.spec_from_file_location(name, str(loc)) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module