Skip to content

Commit e38ada1

Browse files
authored
Merge pull request #1 from rayluo/patch-1
Refine inline comments
2 parents 1b5f025 + d72ab66 commit e38ada1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

msal_extensions/persistence.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@
2929
def _mkdir_p(path):
3030
"""Creates a directory, and any necessary parents.
3131
32-
This implementation based on a Stack Overflow question that can be found here:
33-
https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
34-
3532
If the path provided is an existing file, this function raises an exception.
3633
:param path: The directory name that should be created.
3734
"""
3835
if not path:
3936
return # NO-OP
4037

4138
if sys.version_info >= (3, 2):
42-
# Can just use the standard Python functionality if it's recent enough (and the
43-
# manual handling below can be dropped altogether when Python 2 support goes)
44-
return os.makedirs(path, exist_ok=True)
39+
os.makedirs(path, exist_ok=True)
40+
return
4541

42+
# This fallback implementation is based on a Stack Overflow question:
43+
# https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
44+
# Known issue: it won't work when the path is a root folder like "C:\\"
4645
try:
4746
os.makedirs(path)
4847
except OSError as exp:

0 commit comments

Comments
 (0)