Fix wallet write to support windows
This commit is contained in:
parent
80513745d5
commit
21673c95f4
|
@ -135,15 +135,18 @@ class WalletStorage(object):
|
|||
|
||||
def write(self):
|
||||
assert not threading.currentThread().isDaemon()
|
||||
temp_path = self.path + '.tmp'
|
||||
s = json.dumps(self.data, indent=4, sort_keys=True)
|
||||
with open(self.path + '.tmp', "w") as f:
|
||||
with open(temp_path, "w") as f:
|
||||
f.write(s)
|
||||
os.rename(self.path + '.tmp', self.path)
|
||||
os.remove(self.path)
|
||||
os.rename(temp_path, self.path)
|
||||
if 'ANDROID_DATA' not in os.environ:
|
||||
import stat
|
||||
os.chmod(self.path,stat.S_IREAD | stat.S_IWRITE)
|
||||
|
||||
|
||||
|
||||
class Abstract_Wallet(object):
|
||||
"""
|
||||
Wallet classes are created to handle various address generation methods.
|
||||
|
|
Loading…
Reference in New Issue