summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-04-28 14:51:08 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-04-28 14:51:08 (GMT)
commitc5e448524818df5858e1fe98ce81aeb5ca3a14c4 (patch)
tree27b36363e476e8cee3ff8dcb0e73326eb552c4eb /Modules
parent54677da895fdb4a58b15cf46cadd0659db6eb3e9 (diff)
downloadcpython-c5e448524818df5858e1fe98ce81aeb5ca3a14c4.zip
cpython-c5e448524818df5858e1fe98ce81aeb5ca3a14c4.tar.gz
cpython-c5e448524818df5858e1fe98ce81aeb5ca3a14c4.tar.bz2
Issue 8202: when using the -m command line switch, sys.argv[0] is now '-m' instead of '-c' while searching for the module to be executed
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 11ac97e..2f5dc57 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -519,10 +519,10 @@ Py_Main(int argc, char **argv)
}
if (module != NULL) {
- /* Backup _PyOS_optind and force sys.argv[0] = '-c'
+ /* Backup _PyOS_optind and force sys.argv[0] = '-m'
so that PySys_SetArgv correctly sets sys.path[0] to ''*/
_PyOS_optind--;
- argv[_PyOS_optind] = "-c";
+ argv[_PyOS_optind] = "-m";
}
PySys_SetArgv(argc-_PyOS_optind, argv+_PyOS_optind);