mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-14 05:39:23 +03:00
feat(core): update _import_utils.py to not mask the thrown exception (#32071)
This commit is contained in:
1 parent
b49372595e
commit
d3072e2d2e
1 file changed
+2
-2
@@ -27,8 +27,8 @@ def import_attr(
|
||||
else:
|
||||
try:
|
||||
module = import_module(f".{module_name}", package=package)
|
||||
except ModuleNotFoundError:
|
||||
msg = f"module '{package!r}.{module_name!r}' not found"
|
||||
except ModuleNotFoundError as err:
|
||||
msg = f"module '{package!r}.{module_name!r}' not found ({err})"
|
||||
raise ImportError(msg) from None
|
||||
result = getattr(module, attr_name)
|
||||
return result
|
||||
Reference in new issue
Block a user