We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6eb32db commit bfbe585Copy full SHA for bfbe585
src/imcflibs/pathtools.py
@@ -366,18 +366,13 @@ def folder_size(source):
366
def create_directory(new_path):
367
"""Create a new directory at the specified path.
368
369
- This function first checks if the directory already exists and only
370
- attempts to create it if it doesn't exist.
+ This is a workaround for Python 2.7 where `os.makedirs()` is lacking
+ the `exist_ok` parameter that is present in Python 3.2 and newer.
371
372
Parameters
373
----------
374
new_path : str
375
Path where the new directory should be created.
376
-
377
- Notes
378
- -----
379
- This approach is used as a workaround for Python 2.7 which doesn't
380
- have the exist_ok' parameter in os.makedirs().
381
"""
382
383
if not os.path.exists(new_path):
0 commit comments