[Python-checkins] r46893 - python/trunk/Modules/main.c

nick.coghlan python-checkins at python.org
Mon Jun 12 12:17:11 CEST 2006


Author: nick.coghlan
Date: Mon Jun 12 12:17:11 2006
New Revision: 46893

Modified:
   python/trunk/Modules/main.c
Log:
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch

Modified: python/trunk/Modules/main.c
==============================================================================
--- python/trunk/Modules/main.c	(original)
+++ python/trunk/Modules/main.c	Mon Jun 12 12:17:11 2006
@@ -462,9 +462,10 @@
 	}
 
 	if (module != NULL) {
-		/* Backup _PyOS_optind and force sys.arv[0] = module */
+		/* Backup _PyOS_optind and force sys.argv[0] = '-c'
+		   so that PySys_SetArgv correctly sets sys.path[0] to ''*/
 		_PyOS_optind--;
-        argv[_PyOS_optind] = module;
+		argv[_PyOS_optind] = "-c";
 	}
 
 	PySys_SetArgv(argc-_PyOS_optind, argv+_PyOS_optind);


More information about the Python-checkins mailing list