kivy's python-for-android can import stat

This commit is contained in:
ThomasV 2016-03-10 10:39:47 +01:00
parent 35fe8fc0c1
commit a57274930b
1 changed files with 4 additions and 7 deletions

View File

@ -32,11 +32,12 @@ import time
import json
import copy
import re
import stat
from functools import partial
from unicodedata import normalize
from collections import namedtuple
from i18n import _
from i18n import _
from util import NotEnoughFunds, PrintError, profiler
from bitcoin import *
@ -140,8 +141,6 @@ class WalletStorage(PrintError):
f.flush()
os.fsync(f.fileno())
if 'ANDROID_DATA' not in os.environ:
import stat
mode = os.stat(self.path).st_mode if os.path.exists(self.path) else stat.S_IREAD | stat.S_IWRITE
# perform atomic write on POSIX systems
try:
@ -149,8 +148,6 @@ class WalletStorage(PrintError):
except:
os.remove(self.path)
os.rename(temp_path, self.path)
if 'ANDROID_DATA' not in os.environ:
import stat
os.chmod(self.path, mode)
self.print_error("saved", self.path)
self.modified = False