Cache attempt to close file
Attempt to close the file passed to the get callback function. Closing is the right thing to do, but it is possible that the user will close it before returning..
This commit is contained in:
parent
d46eca4823
commit
b69e790186
|
@ -21,6 +21,10 @@ class CacheObject:
|
|||
f = open(path, 'w')
|
||||
if func(f, *args):
|
||||
return path
|
||||
try:
|
||||
f.close()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
return path
|
||||
|
||||
|
|
Loading…
Reference in New Issue