summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-08-17 13:06:11 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-08-17 13:06:11 (GMT)
commitd26c18adccf02321592cd58a2dadb0ab68af6906 (patch)
tree0429b57ab0d5cc0b36ca68af24f382c888cbcf9c /Modules/main.c
parent46e63805638e0fac20aeae837e1f93b4a675446a (diff)
downloadcpython-d26c18adccf02321592cd58a2dadb0ab68af6906.zip
cpython-d26c18adccf02321592cd58a2dadb0ab68af6906.tar.gz
cpython-d26c18adccf02321592cd58a2dadb0ab68af6906.tar.bz2
Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/main.c b/Modules/main.c
index f9d0c48..3e7e065 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -604,10 +604,9 @@ Py_Main(int argc, wchar_t **argv)
}
if (module != NULL) {
- /* Backup _PyOS_optind and force sys.argv[0] = '-c'
- so that PySys_SetArgv correctly sets sys.path[0] to ''*/
+ /* Backup _PyOS_optind and force sys.argv[0] = '-m'*/
_PyOS_optind--;
- argv[_PyOS_optind] = L"-c";
+ argv[_PyOS_optind] = L"-m";
}
PySys_SetArgv(argc-_PyOS_optind, argv+_PyOS_optind);