From 0a0b9714c064d9862191765937a2707bdad06754 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Fri, 2 Sep 2022 14:42:57 +0900 Subject: [PATCH] Ignore type of shlex.join Mypy throws an error for any reference to a module member that doesn't exist, even with a clear hasattr check like in this code. https://github.com/python/mypy/issues/5059 --- spacy/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/util.py b/spacy/util.py index 0c42b1529..2a7a296a0 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -975,7 +975,7 @@ def run_command( # As above, this will usually but not always be correct on Windows, but # is only used for debugging purposes. if hasattr(shlex, "join"): - cmd_str = shlex.join(command) + cmd_str = shlex.join(command) # type: ignore else: # shlex.join is more correct, but is only available in 3.8+ cmd_str = " ".join(command)