blob: a0ed7cc830e7d48aa88626f970d26b5c5a734344 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001From ffe7797637f08cd6ee4c82e2d67462c5e194d30a Mon Sep 17 00:00:00 2001
2From: Jaewon Lee <jaewon.lee@xilinx.com>
3Date: Thu, 25 Apr 2019 15:34:26 -0700
4Subject: [PATCH] main.c: if OEPYTHON3HOME is set use instead of PYTHONHOME
5
6There is one variable PYTHONHOME to determine where libraries are coming
7from for both python2 and python3. This becomes an issue if only one has
8libraries in the specified PYTHONHOME path, but they are using the same
9PYTHONHOME. Creating another variable OEPYTHON3HOME to allow for a way
10to set a different path for python3
11
12Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
13
14Upstream-Status: Inappropriate [OE specific configuration]
15---
16 Modules/main.c | 17 +++++++++++++----
17 1 file changed, 13 insertions(+), 4 deletions(-)
18
19diff --git a/Modules/main.c b/Modules/main.c
20index a745381..b553e30 100644
21--- a/Modules/main.c
22+++ b/Modules/main.c
23@@ -1855,10 +1855,19 @@ config_init_home(_PyCoreConfig *config)
24 }
25 return _Py_INIT_OK();
26 }
27-
28- int res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME");
29- if (res < 0) {
30- return DECODE_LOCALE_ERR("PYTHONHOME", res);
31+ int res;
32+ const char *oepython3home = config_get_env_var("OEPYTHON3HOME");
33+ if (oepython3home) {
34+ res = config_get_env_var_dup(&home, L"OEPYTHON3HOME", "OEPYTHON3HOME");
35+ if (res < 0) {
36+ return DECODE_LOCALE_ERR("OEPYTHON3HOME", res);
37+ }
38+ }
39+ else {
40+ res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME");
41+ if (res < 0) {
42+ return DECODE_LOCALE_ERR("PYTHONHOME", res);
43+ }
44 }
45 config->home = home;
46 return _Py_INIT_OK();
47--
482.7.4
49