Skip to content

Commit 5785435

Browse files
and2345Andreas Kunze
andauthored
fix: make sure output file directory exists before trying to open file for writing. Fixes #13 (#14)
Co-authored-by: Andreas Kunze <andreas.kunze@watttron.com>
1 parent 5cb0267 commit 5785435

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pybind11_mkdoc/mkdoc_lib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ def mkdoc(args, width, output=None):
420420

421421
if output:
422422
try:
423+
os.makedirs(os.path.dirname(output), exist_ok=True)
423424
with open(output, 'w') as out_file:
424425
write_header(comments, out_file)
425426
except:

0 commit comments

Comments
 (0)