From 9a9f62caa0343adaa56f05ea4d5efd66d5397044 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 25 Apr 2024 16:42:51 -0400 Subject: [PATCH] x --- libs/langchain/langchain/_api/module_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langchain/langchain/_api/module_import.py b/libs/langchain/langchain/_api/module_import.py index c2319868cf..b352d257b9 100644 --- a/libs/langchain/langchain/_api/module_import.py +++ b/libs/langchain/langchain/_api/module_import.py @@ -21,8 +21,8 @@ ROOT = HERE.parent.parent def _get_current_module(path: str) -> str: """Convert a path to a module name.""" - path = pathlib.Path(os.path.abspath(path)) - relative_path = path.relative_to(ROOT).with_suffix("") + path_as_pathlib = pathlib.Path(os.path.abspath(path)) + relative_path = path_as_pathlib.relative_to(ROOT).with_suffix("") posix_path = relative_path.as_posix() norm_path = os.path.normpath(str(posix_path)) fully_qualified_module = norm_path.replace("/", ".")