diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-12-19 22:48:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 22:48:17 (GMT) |
commit | c4bca951065f4b2b6833f6ce7a0721e863e2343e (patch) | |
tree | 81105844562d19d84e13c051c6a73c7c133ffeb7 /Include | |
parent | f4e21a2a72f76d75a6cc6f74faf910a5f3108482 (diff) | |
download | cpython-c4bca951065f4b2b6833f6ce7a0721e863e2343e.zip cpython-c4bca951065f4b2b6833f6ce7a0721e863e2343e.tar.gz cpython-c4bca951065f4b2b6833f6ce7a0721e863e2343e.tar.bz2 |
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()
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pylifecycle.h | 4 | ||||
-rw-r--r-- | Include/pystate.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 3ea8ad6..77c4330 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -61,7 +61,9 @@ PyAPI_FUNC(int) _PyCoreConfig_Copy( _PyCoreConfig *config, const _PyCoreConfig *config2); -PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read(_PyMainInterpreterConfig *, _PyCoreConfig *); +PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read( + _PyMainInterpreterConfig *config, + const _PyCoreConfig *core_config); PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *); PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy( _PyMainInterpreterConfig *config, diff --git a/Include/pystate.h b/Include/pystate.h index fff134a..ed5b6c9 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -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 |