bpo-32030: Complete _PyCoreConfig_Read() (#4946)

* Add _PyCoreConfig.install_signal_handlers
* Remove _PyMain.config: _PyMainInterpreterConfig usage is now
  restricted to pymain_init_python_main().
* Rename _PyMain.core_config to _PyMain.config
* _PyMainInterpreterConfig_Read() now creates the xoptions dictionary
   from the core config
* Fix _PyMainInterpreterConfig_Read(): don't replace xoptions and
  argv if they are already set.
This commit is contained in:
Victor Stinner 2017-12-20 19:36:46 +01:00 committed by GitHub
parent 51eb1c6b9c
commit 9cfc00262c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 387 additions and 346 deletions

View file

@ -25,6 +25,7 @@ typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int);
typedef struct {
int install_signal_handlers; /* Install signal handlers? -1 means unset */
int ignore_environment; /* -E */
int use_hash_seed; /* PYTHONHASHSEED=x */
unsigned long hash_seed;
@ -62,6 +63,7 @@ typedef struct {
#define _PyCoreConfig_INIT \
(_PyCoreConfig){ \
.install_signal_handlers = -1, \
.use_hash_seed = -1, \
.coerce_c_locale = -1, \
.utf8_mode = -1, \
@ -73,7 +75,7 @@ typedef struct {
* See PEP 432 for final anticipated contents
*/
typedef struct {
int install_signal_handlers;
int install_signal_handlers; /* Install signal handlers? -1 means unset */
PyObject *argv; /* sys.argv list, can be NULL */
PyObject *executable; /* sys.executable str */
PyObject *prefix; /* sys.prefix str */