-
Notifications
You must be signed in to change notification settings - Fork 3
Labels
questionFurther information is requestedFurther information is requested
Milestone
Description
The function doesn't add any value compared to a simple os.makedirs() call, as nothing is done except checking for existence of the target directory (no logging, no else-clause, ...). The situation when the target exists is gracefully handled by os.makedirs() already.
So actually this only adds complexity to the library and makes the code harder to read for people not familiar with it (requiring them to look up the API docs or similar).
python-imcflibs/src/imcflibs/pathtools.py
Lines 360 to 369 in 1d832b5
| def create_directory(new_path): | |
| """create a new directory if it does not already exist | |
| Parameters | |
| ---------- | |
| new_path : str | |
| Path to the new directory | |
| """ | |
| if not os.path.exists(new_path): | |
| os.makedirs(new_path) |