summaryrefslogtreecommitdiffstats
path: root/Mac/Python/macmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Python/macmain.c')
-rw-r--r--Mac/Python/macmain.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c
index b86b528..71b42e9 100644
--- a/Mac/Python/macmain.c
+++ b/Mac/Python/macmain.c
@@ -316,8 +316,14 @@ init_common(int *argcp, char ***argvp, int embedded)
*argcp = 1;
*argvp = emb_argv;
} else {
- /* Create argc/argv. Do it before we go into the options event loop. */
- *argcp = PyMac_GetArgv(argvp, PyMac_options.noargs);
+ /* Create argc/argv. Do it before we go into the options event loop.
+ ** In MachoPython we skip this step if we already have plausible
+ ** command line arguments.
+ */
+#if TARGET_API_MAC_OSX
+ if (*argcp == 2 && strncmp((*argvp)[1], "-psn_", 5) == 0)
+#endif
+ *argcp = PyMac_GetArgv(argvp, PyMac_options.noargs);
#if !TARGET_API_MAC_OSX
#ifndef NO_ARGV0_CHDIR
if (*argcp >= 1 && (*argvp)[0] && (*argvp)[0][0]) {