[Python-checkins] CVS: python/dist/src/Mac/Python macmain.c,1.72,1.72.8.1

Jack Jansen jackjansen@users.sourceforge.net
Sun, 24 Feb 2002 15:07:07 -0800


Update of /cvsroot/python/python/dist/src/Mac/Python
In directory usw-pr-cvs1:/tmp/cvs-serv22904

Modified Files:
      Tag: release22-maint
	macmain.c 
Log Message:
bqackport of 1.73:
In MachoPython, don't simulate argc/argv unless we have argc=1 and argv[1]
starts with "-psn_". This means the drag-and-drop continues to work as
expected, but we can now also do
/Applications/Python.app/Contents/MacOS/python script.py
from the command line, which is a lot easier with debugging. Pressing <option>
at this point also has the expected effect of opening the options dialog!



Index: macmain.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Python/macmain.c,v
retrieving revision 1.72
retrieving revision 1.72.8.1
diff -C2 -d -r1.72 -r1.72.8.1
*** macmain.c	31 Oct 2001 22:54:27 -0000	1.72
--- macmain.c	24 Feb 2002 23:07:04 -0000	1.72.8.1
***************
*** 317,322 ****
  		*argvp = emb_argv;
  	} else {
! 		/* Create argc/argv. Do it before we go into the options event loop. */
! 		*argcp = PyMac_GetArgv(argvp, PyMac_options.noargs);
  #if !TARGET_API_MAC_OSX
  #ifndef NO_ARGV0_CHDIR
--- 317,328 ----
  		*argvp = emb_argv;
  	} else {
! 		/* 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