Skip to content

Commit cfb41e8

Browse files
authored
bpo-42260: Reorganize PyConfig (GH-23149)
* Move orig_argv before argv * Move program_name and platlibdir with other path configuration inputs Give a name to the PyPreConfig and PyConfig structures and separate the type definitions.
1 parent 8021875 commit cfb41e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Include/cpython/initconfig.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
4141

4242
/* --- PyPreConfig ----------------------------------------------- */
4343

44-
typedef struct {
44+
typedef struct PyPreConfig {
4545
int _config_init; /* _PyConfigInitEnum value */
4646

4747
/* Parse Py_PreInitializeFromBytesArgs() arguments?
@@ -128,7 +128,7 @@ PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
128128
/* --- PyConfig ---------------------------------------------- */
129129

130130
/* This structure is best documented in the Doc/c-api/init_config.rst file. */
131-
typedef struct {
131+
typedef struct PyConfig {
132132
int _config_init; /* _PyConfigInitEnum value */
133133

134134
int isolated;
@@ -147,8 +147,8 @@ typedef struct {
147147
wchar_t *filesystem_errors;
148148
wchar_t *pycache_prefix;
149149
int parse_argv;
150+
PyWideStringList orig_argv;
150151
PyWideStringList argv;
151-
wchar_t *program_name;
152152
PyWideStringList xoptions;
153153
PyWideStringList warnoptions;
154154
int site_import;
@@ -169,12 +169,13 @@ typedef struct {
169169
int legacy_windows_stdio;
170170
#endif
171171
wchar_t *check_hash_pycs_mode;
172-
PyWideStringList orig_argv;
173172

174173
/* --- Path configuration inputs ------------ */
175174
int pathconfig_warnings;
175+
wchar_t *program_name;
176176
wchar_t *pythonpath_env;
177177
wchar_t *home;
178+
wchar_t *platlibdir;
178179

179180
/* --- Path configuration outputs ----------- */
180181
int module_search_paths_set;
@@ -185,7 +186,6 @@ typedef struct {
185186
wchar_t *base_prefix;
186187
wchar_t *exec_prefix;
187188
wchar_t *base_exec_prefix;
188-
wchar_t *platlibdir;
189189

190190
/* --- Parameter only used by Py_Main() ---------- */
191191
int skip_source_first_line;

0 commit comments

Comments
 (0)