Skip to content

Commit

Permalink
Filter out macOS -psn_0_XXXXXX weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Dec 31, 2017
1 parent 501f3ba commit 916b8a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pext/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,16 @@ def _load_settings(argv: List[str], config_retriever: ConfigRetriever) -> None:
parser.add_argument('--tray', action='store_true', dest='tray', help='create a tray icon (this is the default).')
parser.add_argument('--no-tray', action='store_false', dest='tray', help='do not create a tray icon.')

# Remove weird macOS-added parameter
# https://stackoverflow.com/questions/10242115/os-x-strange-psn-command-line-parameter-when-launched-from-finder
if platform.system() == "Darwin":
proper_argv = []
for arg in argv:
if not arg.startswith("-psn_0_"):
proper_argv.append(arg)

argv = proper_argv

# Ensure module options get parsed
for arg in argv:
arg = arg.split("=")[0]
Expand Down

0 comments on commit 916b8a8

Please sign in to comment.