We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b13b2ba commit 133df4dCopy full SHA for 133df4d
plotly/files.py
@@ -27,12 +27,20 @@
27
def _permissions():
28
try:
29
if not os.path.exists(PLOTLY_DIR):
30
- os.mkdir(PLOTLY_DIR)
+ try:
31
+ os.mkdir(PLOTLY_DIR)
32
+ except Exception:
33
+ # in case of race
34
+ if not os.path.isdir(PLOTLY_DIR):
35
+ raise
36
with open(TEST_FILE, 'w') as f:
37
f.write('testing\n')
- os.remove(TEST_FILE)
38
39
+ os.remove(TEST_FILE)
40
41
+ pass
42
return True
- except:
43
+ except Exception: # Do not trap KeyboardInterrupt.
44
return False
45
46
0 commit comments