diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2006-06-12 10:17:11 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-06-12 10:17:11 (GMT) |
commit | 81f444bb8eca9caedc884caf566c76233762077e (patch) | |
tree | 475385c5e069bd22178e8b4b2b405d1bcc85fb17 /Modules/main.c | |
parent | f0d02fbb9a9d8a8ec8729865b4bb9390bb13a73c (diff) | |
download | cpython-81f444bb8eca9caedc884caf566c76233762077e.zip cpython-81f444bb8eca9caedc884caf566c76233762077e.tar.gz cpython-81f444bb8eca9caedc884caf566c76233762077e.tar.bz2 |
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c index 5a55036..0beea73 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -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); |