def RunAsAdminUnixLike():
# FIXME ... what happens if "frozen"
script = os.path.abspath(sys.argv[0])
params = [sys.executable]
if sys.executable != script:
params.append(script)
# CHECK Seems logic to always extend
params.extend(sys.argv[1:])
# FIXME ... execute the command directly
try:
os.execvp('sudo', params)
except Exception, e:
return False, str(e)
# If execvp was ok ... this will never be reached
return True, None
评论列表
文章目录