We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be3dab6 + 4676c42 commit b35979eCopy full SHA for b35979e
plotly/files.py
@@ -22,18 +22,22 @@
22
'sharing': 'public',
23
'auto_open': True}}
24
25
-try:
26
- os.mkdir(TEST_DIR)
27
- os.rmdir(TEST_DIR)
28
- if not os.path.exists(PLOTLY_DIR):
29
- os.mkdir(PLOTLY_DIR)
30
- f = open(TEST_FILE, 'w')
31
- f.write('testing\n')
32
- f.close()
33
- os.remove(TEST_FILE)
34
- _file_permissions = True
35
-except:
36
- _file_permissions = False
+
+def _permissions():
+ try:
+ os.mkdir(TEST_DIR)
+ os.rmdir(TEST_DIR)
+ if not os.path.exists(PLOTLY_DIR):
+ os.mkdir(PLOTLY_DIR)
+ with open(TEST_FILE, 'w') as f:
+ f.write('testing\n')
+ os.remove(TEST_FILE)
+ return True
+ except:
37
+ return False
38
39
40
+_file_permissions = _permissions()
41
42
43
def check_file_permissions():
0 commit comments