From e08117adff50d8db0b1fd7a94f8236665bfa4124 Mon Sep 17 00:00:00 2001 From: "Vladimir Gladkov (office-arch)" Date: Thu, 16 Apr 2020 19:39:47 +0800 Subject: [PATCH] [sphinx] don't use os.path.makedirs(exist_ok=True) as it doesn't work on python 2 --- sphinx/doxyrest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sphinx/doxyrest.py b/sphinx/doxyrest.py index 8eea825eb..10ff46fe4 100644 --- a/sphinx/doxyrest.py +++ b/sphinx/doxyrest.py @@ -396,7 +396,9 @@ def on_config_inited(app, config): contents = contents.replace('%tab_width%', str(config.doxyrest_tab_width)) src_file.close() - os.makedirs(app.doctreedir, exist_ok=True) + if not os.path.exists(app.doctreedir): + os.makedirs(app.doctreedir) + dst_file = open(docutils_conf_path, 'w') dst_file.write(contents) dst_file.close()