Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-32030: Add _PyCoreConfig.module_search_paths #4954

Merged
merged 4 commits into from
Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions Include/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,24 @@ typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int);

typedef struct {
int install_signal_handlers; /* Install signal handlers? -1 means unset */
int ignore_environment; /* -E */

int ignore_environment; /* -E, Py_IgnoreEnvironmentFlag */
int use_hash_seed; /* PYTHONHASHSEED=x */
unsigned long hash_seed;
int _disable_importlib; /* Needed by freeze_importlib */
const char *allocator; /* Memory allocator: _PyMem_SetupAllocators() */
int dev_mode; /* -X dev */
int faulthandler; /* -X faulthandler */
int tracemalloc; /* -X tracemalloc=N */
int import_time; /* -X importtime */
int dev_mode; /* PYTHONDEVMODE, -X dev */
int faulthandler; /* PYTHONFAULTHANDLER, -X faulthandler */
int tracemalloc; /* PYTHONTRACEMALLOC, -X tracemalloc=N */
int import_time; /* PYTHONPROFILEIMPORTTIME, -X importtime */
int show_ref_count; /* -X showrefcount */
int show_alloc_count; /* -X showalloccount */
int dump_refs; /* PYTHONDUMPREFS */
int malloc_stats; /* PYTHONMALLOCSTATS */
int coerce_c_locale; /* PYTHONCOERCECLOCALE, -1 means unknown */
int coerce_c_locale_warn; /* PYTHONCOERCECLOCALE=warn */
int utf8_mode; /* -X utf8 or PYTHONUTF8 environment variable,
-1 means unknown */
int utf8_mode; /* PYTHONUTF8, -X utf8; -1 means unknown */

wchar_t *module_search_path_env; /* PYTHONPATH environment variable */
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; /* Command line arguments */
Expand All @@ -59,6 +54,24 @@ typedef struct {

int nwarnoption; /* Number of warnings options */
wchar_t **warnoptions; /* Warnings options */

/* Path configuration inputs */
wchar_t *module_search_path_env; /* PYTHONPATH environment variable */
wchar_t *home; /* PYTHONHOME environment variable,
see also Py_SetPythonHome(). */

/* Path configuration outputs */
int nmodule_search_path; /* Number of sys.path paths,
-1 means unset */
wchar_t **module_search_paths; /* sys.path paths */
wchar_t *executable; /* sys.executable */
wchar_t *prefix; /* sys.prefix */
wchar_t *base_prefix; /* sys.base_prefix */
wchar_t *exec_prefix; /* sys.exec_prefix */
wchar_t *base_exec_prefix; /* sys.base_exec_prefix */

/* Private fields */
int _disable_importlib; /* Needed by freeze_importlib */
} _PyCoreConfig;

#define _PyCoreConfig_INIT \
Expand All @@ -67,7 +80,8 @@ typedef struct {
.use_hash_seed = -1, \
.coerce_c_locale = -1, \
.utf8_mode = -1, \
.argc = -1}
.argc = -1, \
.nmodule_search_path = -1}
/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */

/* Placeholders while working on the new configuration API
Expand Down
Loading