summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2007-08-25 10:50:41 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2007-08-25 10:50:41 (GMT)
commit1a42ece0c76166b1dead10decb0e54af084b4eb2 (patch)
tree9940ea5ca96c0dc92e6e282853457349a502a7fa /Modules
parentb90f52e93261e94c994893a167c5fb18394f84ac (diff)
downloadcpython-1a42ece0c76166b1dead10decb0e54af084b4eb2.zip
cpython-1a42ece0c76166b1dead10decb0e54af084b4eb2.tar.gz
cpython-1a42ece0c76166b1dead10decb0e54af084b4eb2.tar.bz2
Fix bug 1764407 - the -i switch now does the right thing when using the -m switch
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 7777db1..59b0e9f 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -149,17 +149,16 @@ static int RunModule(char *module)
fprintf(stderr, "Could not import runpy module\n");
return -1;
}
- runmodule = PyObject_GetAttrString(runpy, "run_module");
+ runmodule = PyObject_GetAttrString(runpy, "_run_module_as_main");
if (runmodule == NULL) {
- fprintf(stderr, "Could not access runpy.run_module\n");
+ fprintf(stderr, "Could not access runpy._run_module_as_main\n");
Py_DECREF(runpy);
return -1;
}
- runargs = Py_BuildValue("sOsO", module,
- Py_None, "__main__", Py_True);
+ runargs = Py_BuildValue("(s)", module);
if (runargs == NULL) {
fprintf(stderr,
- "Could not create arguments for runpy.run_module\n");
+ "Could not create arguments for runpy._run_module_as_main\n");
Py_DECREF(runpy);
Py_DECREF(runmodule);
return -1;