mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-19 21:33:31 -04:00
changed ValueError to ImportError (#5006)
# changed ValueError to ImportError in except Several places with this bug. ValueError does not catch ImportError.
This commit is contained in:
@@ -15,7 +15,7 @@ class Wikipedia(Docstore):
|
||||
try:
|
||||
import wikipedia # noqa: F401
|
||||
except ImportError:
|
||||
raise ValueError(
|
||||
raise ImportError(
|
||||
"Could not import wikipedia python package. "
|
||||
"Please install it with `pip install wikipedia`."
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ class ArxivAPIWrapper(BaseModel):
|
||||
)
|
||||
values["arxiv_result"] = arxiv.Result
|
||||
except ImportError:
|
||||
raise ValueError(
|
||||
raise ImportError(
|
||||
"Could not import arxiv python package. "
|
||||
"Please install it with `pip install arxiv`."
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@ class WikipediaAPIWrapper(BaseModel):
|
||||
wikipedia.set_lang(values["lang"])
|
||||
values["wiki_client"] = wikipedia
|
||||
except ImportError:
|
||||
raise ValueError(
|
||||
raise ImportError(
|
||||
"Could not import wikipedia python package. "
|
||||
"Please install it with `pip install wikipedia`."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user