]> granicus.if.org Git - python/commit
bpo-32030: Fix Py_GetPath(): init program_name (#4665)
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 1 Dec 2017 18:30:41 +0000 (19:30 +0100)
committerGitHub <noreply@github.com>
Fri, 1 Dec 2017 18:30:41 +0000 (19:30 +0100)
commit9ac3d8882712c9675c3d2f9f84af6b5729575cde
tree2baab6354b64c2771810aeb73596280f2c126f7c
parentb64de46aae148cfab0980e0ad478da7aafc44900
bpo-32030: Fix Py_GetPath(): init program_name (#4665)

* _PyMainInterpreterConfig_ReadEnv() now sets program_name from
  environment variables and pymain_parse_envvars() implements the
  falls back on argv[0].
* Remove _PyMain.program_name: use the program_name from
  _PyMainInterpreterConfig
* Move the Py_SetProgramName() call back to pymain_init_python(),
  just before _Py_InitializeCore().
* pathconfig_global_init() now also calls
  _PyMainInterpreterConfig_Read() to set program_name if it isn't set
  yet
* Cleanup PyCalculatePath: pass main_config to subfunctions to get
  directly fields from main_config (home, module_search_path_env and
  program_name)
Modules/getpath.c
Modules/main.c
PC/getpathp.c