summaryrefslogtreecommitdiffstats
path: root/Programs/_testembed.c
diff options
context:
space:
mode:
authorSandro Mani <manisandro@gmail.com>2020-06-08 15:28:11 (GMT)
committerGitHub <noreply@github.com>2020-06-08 15:28:11 (GMT)
commit8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae (patch)
tree8aa9027476167eca69c0e17ba8712f624bdb8e15 /Programs/_testembed.c
parentc6b292cdeee689f0bfac6c1e2c2d4e4e01fa8d9e (diff)
downloadcpython-8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae.zip
cpython-8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae.tar.gz
cpython-8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae.tar.bz2
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605)
Diffstat (limited to 'Programs/_testembed.c')
-rw-r--r--Programs/_testembed.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 5c83678..11524df 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -548,6 +548,13 @@ static int test_init_from_config(void)
/* FIXME: test home */
/* FIXME: test path config: module_search_path .. dll_path */
+ putenv("PYTHONPLATLIBDIR=env_platlibdir");
+ status = PyConfig_SetBytesString(&config, &config.platlibdir, "my_platlibdir");
+ if (PyStatus_Exception(status)) {
+ PyConfig_Clear(&config);
+ Py_ExitStatusException(status);
+ }
+
putenv("PYTHONVERBOSE=0");
Py_VerboseFlag = 0;
config.verbose = 1;
@@ -668,6 +675,7 @@ static void set_most_env_vars(void)
putenv("PYTHONFAULTHANDLER=1");
putenv("PYTHONIOENCODING=iso8859-1:replace");
putenv("PYTHONOLDPARSER=1");
+ putenv("PYTHONPLATLIBDIR=env_platlibdir");
}