From b16ef28cff62bc12cd883b0ad302d0a213b0e466 Mon Sep 17 00:00:00 2001 From: StellarisW Date: Fri, 8 Nov 2024 11:19:19 +0800 Subject: [PATCH] fix: sub module conflict error --- thriftpy2/parser/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thriftpy2/parser/parser.py b/thriftpy2/parser/parser.py index c7b4059..6a1cd49 100644 --- a/thriftpy2/parser/parser.py +++ b/thriftpy2/parser/parser.py @@ -63,12 +63,12 @@ def p_include(p): path = os.path.join(include_dir, p[2]) if os.path.exists(path): child_path = os.path.normpath( - os.path.dirname(remove_suffix(str(thrift.__name__), "_thrift").replace(".", "/")) + "/" + p[2]) + os.path.dirname(remove_suffix(str(thrift.__name__), "_thrift").replace(".", os.sep)) + os.sep + p[2]) - child_path = child_path.lstrip("/") + child_path = child_path.lstrip(os.sep) child_module_name = str( - child_path).replace("/", + child_path).replace(os.sep, ".").replace( ".thrift", "_thrift")