Skip to content

Commit

Permalink
replace .split('/') with os.path.split
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Aug 12, 2024
1 parent b3a6743 commit e24c3e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pymodule/mkdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e24c3e4

Please sign in to comment.