summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-05 14:12:41 (GMT)
committerGitHub <noreply@github.com>2017-12-05 14:12:41 (GMT)
commit33c377ed9b6cb3b9493005314c4e0cfa7517ea65 (patch)
tree57c547459a63179830eba576c4ea2959a605c117 /Modules/main.c
parentae342cf7deebdcf2035f4064609b32b2102dadcf (diff)
downloadcpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.zip
cpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.tar.gz
cpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.tar.bz2
bpo-32030: Simplify _PyCoreConfig_INIT macro (#4728)
* Simplify _PyCoreConfig_INIT, _PyMainInterpreterConfig_INIT, _PyPathConfig_INIT macros: no need to set fields to 0/NULL, it's redundant (the C language sets them to 0/NULL for us). * Fix typo: pymain_run_statup() => pymain_run_startup() * Remove a few XXX/TODO
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 4095259..e2ca72c 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -160,7 +160,7 @@ pymain_get_env_var(const char *name)
static void
-pymain_run_statup(PyCompilerFlags *cf)
+pymain_run_startup(PyCompilerFlags *cf)
{
char *startup = Py_GETENV("PYTHONSTARTUP");
if (startup == NULL || startup[0] == '\0') {
@@ -367,8 +367,6 @@ pymain_run_file(FILE *fp, const wchar_t *filename, PyCompilerFlags *p_cf)
/* Main program */
-/*TODO: Add arg processing to PEP 432 as a new configuration setup API
- */
typedef struct {
size_t len;
wchar_t **options;
@@ -949,8 +947,6 @@ pymain_get_program_name(_PyMain *pymain)
*
* Replaces previous call to Py_Initialize()
*
- * TODO: Move environment queries (etc) into Py_ReadConfig
- *
* Return 0 on success.
* Set pymain->err and return -1 on error.
*/
@@ -1121,10 +1117,9 @@ pymain_run_filename(_PyMain *pymain)
if (cmdline->filename == NULL && pymain->stdin_is_interactive) {
Py_InspectFlag = 0; /* do exit on SystemExit */
- pymain_run_statup(&pymain->cf);
+ pymain_run_startup(&pymain->cf);
pymain_run_interactive_hook();
}
- /* XXX */
if (pymain->main_importer_path != NULL) {
pymain->status = pymain_run_main_from_importer(pymain);
@@ -1162,7 +1157,7 @@ pymain_repl(_PyMain *pymain)
Py_InspectFlag = 0;
pymain_run_interactive_hook();
- /* XXX */
+
int res = PyRun_AnyFileFlags(stdin, "<stdin>", &pymain->cf);
pymain->status = (res != 0);
}
@@ -1630,7 +1625,6 @@ pymain_init(_PyMain *pymain)
}
pymain->core_config._disable_importlib = 0;
- /* TODO: Moar config options! */
pymain->config.install_signal_handlers = 1;
orig_argc = pymain->argc; /* For Py_GetArgcArgv() */