Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions plotly/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@
def _permissions():
try:
if not os.path.exists(PLOTLY_DIR):
os.mkdir(PLOTLY_DIR)
try:
os.mkdir(PLOTLY_DIR)
except Exception:
# in case of race
if not os.path.isdir(PLOTLY_DIR):
raise
with open(TEST_FILE, 'w') as f:
f.write('testing\n')
os.remove(TEST_FILE)
try:
os.remove(TEST_FILE)
except Exception:
pass
return True
except:
except Exception: # Do not trap KeyboardInterrupt.
return False


Expand Down