1 From 5ce3ac59531828ff682646fbba59b2126b28a8aa Mon Sep 17 00:00:00 2001
2 From: Jaewon Lee <jaewon.lee@xilinx.com>
3 Date: Thu, 25 Apr 2019 15:34:26 -0700
4 Subject: [PATCH] main.c: if OEPYTHON3HOME is set use instead of PYTHONHOME
6 There is one variable PYTHONHOME to determine where libraries are coming
7 from for both python2 and python3. This becomes an issue if only one has
8 libraries in the specified PYTHONHOME path, but they are using the same
9 PYTHONHOME. Creating another variable OEPYTHON3HOME to allow for a way
10 to set a different path for python3
12 Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
14 Upstream-Status: Inappropriate [OE specific configuration]
17 Modules/main.c | 17 +++++++++++++----
18 1 file changed, 13 insertions(+), 4 deletions(-)
20 diff --git a/Modules/main.c b/Modules/main.c
21 index acc59c6..407085a 100644
24 @@ -1834,10 +1834,19 @@ config_init_home(_PyCoreConfig *config)
29 - int res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME");
31 - return DECODE_LOCALE_ERR("PYTHONHOME", res);
33 + const char *oepython3home = config_get_env_var("OEPYTHON3HOME");
34 + if (oepython3home) {
35 + res = config_get_env_var_dup(&home, L"OEPYTHON3HOME", "OEPYTHON3HOME");
37 + return DECODE_LOCALE_ERR("OEPYTHON3HOME", res);
41 + res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME");
43 + return DECODE_LOCALE_ERR("PYTHONHOME", res);