From e24c3e451447937c3bae6285bf7ef7d614308458 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Mon, 12 Aug 2024 09:40:19 +0200 Subject: [PATCH] replace .split('/') with os.path.split --- src/pymodule/mkdoc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pymodule/mkdoc.py b/src/pymodule/mkdoc.py index 5d80d3b..403e5cd 100755 --- a/src/pymodule/mkdoc.py +++ b/src/pymodule/mkdoc.py @@ -128,17 +128,17 @@ def get_ignore_doc(header): else: prg.set_postfix_str(header) - filename = header.split("/")[-1] - output_path = "/".join(header.split("/")[:-1]) + "/.docstrings/" + \ + filepath, filename = os.path.split(header) + output_path = str(filepath) + "/.docstrings/" + \ filename.replace(filename.split('.')[-1], "doc.hpp") if FORCE_RENEW: try: - shutil.rmtree("/".join(output_path.split('/')[:-1])) + shutil.rmtree(os.path.split(output_path)[0]) except: pass continue - os.makedirs("/".join(output_path.split('/')[:-1]), exist_ok=True) + os.makedirs(os.path.split(output_path)[0], exist_ok=True) add_doc_line(header, output_path)