Browse Source

fix bug introduced in 21673c95f4

283
ThomasV 10 years ago
parent
commit
cb09d88322
  1. 4
      lib/wallet.py

4
lib/wallet.py

@ -139,6 +139,10 @@ 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)
# perform atomic write on POSIX systems
try:
os.rename(temp_path, self.path)
except:
os.remove(self.path) os.remove(self.path)
os.rename(temp_path, self.path) os.rename(temp_path, self.path)
if 'ANDROID_DATA' not in os.environ: if 'ANDROID_DATA' not in os.environ:

Loading…
Cancel
Save