Apparently there exist a lot of Macs out there with completely broken permissions on the home folders. Workaround that.

This commit is contained in:
Kovid Goyal 2014-12-21 10:22:56 +05:30
parent 1f44713c4b
commit a19441dc88

View File

@ -224,7 +224,13 @@ elif islinux:
return True return True
else: else:
def singleinstance_path(name): def singleinstance_path(name):
return os.path.expanduser('~/.'+__appname__+'_'+name+'.lock') home = os.path.expanduser('~')
if os.access(home, os.W_OK|os.R_OK|os.X_OK):
basename = __appname__+'_'+name+'.lock'
return os.path.expanduser('~/.' + basename)
import tempfile
tdir = tempfile.gettempdir()
return os.path.join(tdir, '%s_%s_%s.lock' % (__appname__, name, os.geteuid()))
def singleinstance(name): def singleinstance(name):
''' '''