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.
1 parent f0163f2 commit 7bc551aCopy full SHA for 7bc551a
stormdb/base.py
@@ -12,27 +12,18 @@
12
13
14
def check_destination_exists(dest):
15
- return(os.access, os.F_OK)
+ return os.access(dest, os.F_OK)
16
17
18
def check_destination_writable(dest):
19
- try:
20
- open(dest, 'w')
21
- except IOError:
22
- return False
23
- else:
24
- os.remove(dest)
+ if (not check_destination_exists(dest)
+ and os.access(os.path.dirname(dest), os.W_OK)):
25
return True
+ return False # don't bother checking for writability if exists
26
27
28
def check_source_readable(source):
29
30
- fid = open(source, 'r')
31
32
33
34
- fid.close()
35
- return True
+ return os.access(source, os.R_OK)
36
37
38
def enforce_path_exists(test_dir):
0 commit comments