bpo-32030: Add _PyCoreConfig.argv (#4934)

* Add argc and argv to _PyCoreConfig
* _PyMainInterpreterConfig_Read() now builds its argv from
  _PyCoreConfig.arg
* Move _PyMain.env_warning_options into _Py_CommandLineDetails
* Reorder pymain_free()
This commit is contained in:
Victor Stinner 2017-12-19 23:48:17 +01:00 committed by GitHub
parent f4e21a2a72
commit c4bca95106
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 263 additions and 181 deletions

View file

@ -47,10 +47,18 @@ typedef struct {
wchar_t *home; /* PYTHONHOME environment variable,
see also Py_SetPythonHome(). */
wchar_t *program_name; /* Program name, see also Py_GetProgramName() */
int argc; /* Number of command line arguments,
-1 means unset */
wchar_t **argv; /* sys.argv, ignored if argc is negative */
} _PyCoreConfig;
#define _PyCoreConfig_INIT \
(_PyCoreConfig){.use_hash_seed = -1, .coerce_c_locale = -1, .utf8_mode = -1}
(_PyCoreConfig){ \
.use_hash_seed = -1, \
.coerce_c_locale = -1, \
.utf8_mode = -1, \
.argc = -1}
/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
/* Placeholders while working on the new configuration API