fix bug introduced in 21673c95f4
This commit is contained in:
parent
e5cc79e65e
commit
cb09d88322
|
@ -139,8 +139,12 @@ class WalletStorage(object):
|
||||||
s = json.dumps(self.data, indent=4, sort_keys=True)
|
s = json.dumps(self.data, indent=4, sort_keys=True)
|
||||||
with open(temp_path, "w") as f:
|
with open(temp_path, "w") as f:
|
||||||
f.write(s)
|
f.write(s)
|
||||||
os.remove(self.path)
|
# perform atomic write on POSIX systems
|
||||||
os.rename(temp_path, self.path)
|
try:
|
||||||
|
os.rename(temp_path, self.path)
|
||||||
|
except:
|
||||||
|
os.remove(self.path)
|
||||||
|
os.rename(temp_path, self.path)
|
||||||
if 'ANDROID_DATA' not in os.environ:
|
if 'ANDROID_DATA' not in os.environ:
|
||||||
import stat
|
import stat
|
||||||
os.chmod(self.path,stat.S_IREAD | stat.S_IWRITE)
|
os.chmod(self.path,stat.S_IREAD | stat.S_IWRITE)
|
||||||
|
|
Loading…
Reference in New Issue