diff options
author | Kali Kaneko <kali@leap.se> | 2016-04-17 12:50:59 -0700 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-04-18 16:20:02 -0400 |
commit | c36e86275fe1c9ca4d6932c5103f91f5c2473b2e (patch) | |
tree | 765703d37a7ad53f77bda6f3b6dba58d0e317357 /src | |
parent | 2cb8887119ff1dade6e3a4d9368654a6b67576a4 (diff) |
[bug] avoid osx hanging
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/app.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 9412ccd7..31dba157 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -46,7 +46,15 @@ import os import platform import sys -import psutil + +if platform.system() == "Darwin": + # XXX please ignore pep8 complains, this needs to be executed + # early. + # We need to tune maximum number of files, due to zmq usage + # we hit the limit. + import resource + resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 10240)) + from leap.bitmask import __version__ as VERSION from leap.bitmask.backend.backend_proxy import BackendProxy @@ -66,13 +74,7 @@ from leap.mail import __version__ as MAIL_VERSION import codecs codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) - -if platform.system() == "Darwin": - # We need to tune maximum number of files, due to zmq usage - # we hit the limit. - import resource - resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 10240)) - +import psutil def qt_hack_ubuntu(): """Export two env vars to avoid gui corruption, see #8028""" @@ -172,8 +174,11 @@ def start_app(): } flags.STANDALONE = opts.standalone - if getattr(sys, 'frozen', False): - flags.STANDALONE = True + + if platform.system() != 'Darwin': + # XXX this hangs the OSX bundles. + if getattr(sys, 'frozen', False): + flags.STANDALONE = True flags.OFFLINE = opts.offline flags.MAIL_LOGFILE = opts.mail_log_file |