Ignore -psn_0_* argument on OS X.

See #384.
This commit is contained in:
Florian Bruhin 2015-04-13 14:33:29 +02:00
parent bd9168fdfe
commit 3e1d62171f

View File

@ -119,7 +119,14 @@ def get_argparser():
def main():
"""Main entry point for qutebrowser."""
parser = get_argparser()
args = parser.parse_args()
if sys.platform == 'darwin' and getattr(sys, 'frozen', False):
# Ignore Mac OS X' idiotic -psn_* argument...
# http://stackoverflow.com/questions/19661298/
# http://sourceforge.net/p/cx-freeze/mailman/message/31041783/
argv = [arg for arg in sys.argv[1:] if not arg.startswith('-psn_0_')]
else:
argv = sys.argv[1:]
args = parser.parse_args(argv)
if args.json_args is not None:
# Restoring after a restart.
# When restarting, we serialize the argparse namespace into json, and