mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-08 12:31:49 +00:00
feat(core): update _import_utils.py
to not mask the thrown exception (#32071)
This commit is contained in:
parent
b49372595e
commit
d3072e2d2e
@ -27,8 +27,8 @@ def import_attr(
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
module = import_module(f".{module_name}", package=package)
|
module = import_module(f".{module_name}", package=package)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError as err:
|
||||||
msg = f"module '{package!r}.{module_name!r}' not found"
|
msg = f"module '{package!r}.{module_name!r}' not found ({err})"
|
||||||
raise ImportError(msg) from None
|
raise ImportError(msg) from None
|
||||||
result = getattr(module, attr_name)
|
result = getattr(module, attr_name)
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user