mirror of
https://github.com/aykhans/AzSuicideDataVisualization.git
synced 2025-07-02 06:22:25 +00:00
first commit
This commit is contained in:
17
.venv/Lib/site-packages/jupyter_core/utils/__init__.py
Normal file
17
.venv/Lib/site-packages/jupyter_core/utils/__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
import errno
|
||||
import os
|
||||
|
||||
|
||||
def ensure_dir_exists(path, mode=0o777):
|
||||
"""ensure that a directory exists
|
||||
If it doesn't exist, try to create it, protecting against a race condition
|
||||
if another process is doing the same.
|
||||
The default permissions are determined by the current umask.
|
||||
"""
|
||||
try:
|
||||
os.makedirs(path, mode=mode)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
if not os.path.isdir(path):
|
||||
raise OSError("%r exists but is not a directory" % path)
|
Reference in New Issue
Block a user