bpo-32030: Add _PyMainInterpreterConfig.executable (#4876)

* Add new fields to _PyMainInterpreterConfig:

  * executable
  * prefix
  * base_prefix
  * exec_prefix
  * base_exec_prefix

* _PySys_EndInit() now sets sys attributes from
  _PyMainInterpreterConfig
This commit is contained in:
Victor Stinner 2017-12-15 02:05:29 +01:00 committed by GitHub
parent da273412c4
commit 41264f1cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 92 additions and 69 deletions

View file

@ -52,15 +52,18 @@ typedef struct {
/* Placeholders while working on the new configuration API
*
* See PEP 432 for final anticipated contents
*
* For the moment, just handle the args to _Py_InitializeEx
*/
typedef struct {
int install_signal_handlers;
PyObject *argv; /* sys.argv list, can be NULL */
PyObject *module_search_path; /* sys.path list */
PyObject *warnoptions; /* sys.warnoptions list, can be NULL */
PyObject *xoptions; /* sys._xoptions dict, can be NULL */
PyObject *argv; /* sys.argv list, can be NULL */
PyObject *executable; /* sys.executable str */
PyObject *prefix; /* sys.prefix str */
PyObject *base_prefix; /* sys.base_prefix str, can be NULL */
PyObject *exec_prefix; /* sys.exec_prefix str */
PyObject *base_exec_prefix; /* sys.base_exec_prefix str, can be NULL */
PyObject *warnoptions; /* sys.warnoptions list, can be NULL */
PyObject *xoptions; /* sys._xoptions dict, can be NULL */
PyObject *module_search_path; /* sys.path list */
} _PyMainInterpreterConfig;
#define _PyMainInterpreterConfig_INIT \