]> granicus.if.org Git - python/commitdiff
Make the -m switch conform to the documentation of sys.path by behaving like the...
authorNick Coghlan <ncoghlan@gmail.com>
Mon, 12 Jun 2006 10:17:11 +0000 (10:17 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Mon, 12 Jun 2006 10:17:11 +0000 (10:17 +0000)
Modules/main.c

index 5a55036ef2d2bca77d8a45cc0bf699bac7ef2cdf..0beea737405001a914b13bab4c354b44658731e5 100644 (file)
@@ -462,9 +462,10 @@ Py_Main(int argc, char **argv)
        }
 
        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);