Add fix for interrogate_setup_dot_py
Jochen Sprickerhof
1 year, 11 months ago
0 | From: Jochen Sprickerhof <git@jochen.sprickerhof.de> | |
1 | Date: Wed, 18 May 2022 15:37:59 +0200 | |
2 | Subject: Make sure directory exist before writing to it | |
3 | ||
4 | The directory is created elsewhere in catkin but execution order is not | |
5 | guaranteed so it could happen that it does not exist. | |
6 | --- | |
7 | cmake/interrogate_setup_dot_py.py | 1 + | |
8 | 1 file changed, 1 insertion(+) | |
9 | ||
10 | diff --git a/cmake/interrogate_setup_dot_py.py b/cmake/interrogate_setup_dot_py.py | |
11 | index 5e25fbf..9f9ed01 100644 | |
12 | --- a/cmake/interrogate_setup_dot_py.py | |
13 | +++ b/cmake/interrogate_setup_dot_py.py | |
14 | @@ -207,6 +207,7 @@ def _create_mock_setup_function(setup_module, package_name, outfile): | |
15 | pkgs=pkgs, | |
16 | modules=modules, | |
17 | setup_module=setup_module) | |
18 | + os.makedirs(os.path.dirname(outfile), exist_ok=True) | |
19 | with open(outfile, 'w') as out: | |
20 | out.write('\n'.join(result)) | |
21 |