fixing base UI crash after completing OP guide for the first time (#337)

This commit is contained in:
rbiasini
2018-08-27 10:43:23 -07:00
committed by GitHub
parent 22f0a89cf8
commit 401c4026ac
+2
View File
@@ -272,6 +272,7 @@ def read_db(params_path, key):
return None
def write_db(params_path, key, value):
prev_umask = os.umask(0)
lock = FileLock(params_path+"/.lock", True)
lock.acquire()
@@ -286,6 +287,7 @@ def write_db(params_path, key, value):
os.rename(tmp_path, path)
fsync_dir(os.path.dirname(path))
finally:
os.umask(prev_umask)
lock.release()
class Params(object):