mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-27 08:29:51 +03:00
Add error handling if info function import fails
This commit is contained in:
parent
5c1f9264c2
commit
27d7a21a18
|
@ -13,7 +13,13 @@ from thinc.api import Config, prefer_gpu, require_cpu, require_gpu # noqa: F401
|
|||
from . import pipeline # noqa: F401
|
||||
from . import util
|
||||
from .about import __version__ # noqa: F401
|
||||
from .cli.info import info # noqa: F401
|
||||
try:
|
||||
# Emscripten does not make use of the CLI and can not use the CLI libraries
|
||||
# (typer etc.) that are imported here. Additionally importing requests,
|
||||
# which is also done here, requires a workaround on this platform.
|
||||
from .cli.info import info # noqa: F401
|
||||
except ImportError:
|
||||
info = lambda *args: "Importing the CLI failed. Info function not available."
|
||||
from .errors import Errors
|
||||
from .glossary import explain # noqa: F401
|
||||
from .language import Language
|
||||
|
|
Loading…
Reference in New Issue
Block a user