0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From ffe7797637f08cd6ee4c82e2d67462c5e194d30a 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
  5. There is one variable PYTHONHOME to determine where libraries are coming
  6. from for both python2 and python3. This becomes an issue if only one has
  7. libraries in the specified PYTHONHOME path, but they are using the same
  8. PYTHONHOME. Creating another variable OEPYTHON3HOME to allow for a way
  9. to set a different path for python3
  10. Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
  11. RP: Backported to 3.5.6 (code totally different to original path for
  12. later python versions)
  13. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  14. ---
  15. Modules/main.c | 17 +++++++++++++----
  16. 1 file changed, 13 insertions(+), 4 deletions(-)
  17. Index: Python-3.5.6/Python/pylifecycle.c
  18. ===================================================================
  19. --- Python-3.5.6.orig/Python/pylifecycle.c
  20. +++ Python-3.5.6/Python/pylifecycle.c
  21. @@ -864,7 +864,9 @@ Py_GetPythonHome(void)
  22. {
  23. wchar_t *home = default_home;
  24. if (home == NULL && !Py_IgnoreEnvironmentFlag) {
  25. - char* chome = Py_GETENV("PYTHONHOME");
  26. + char* chome = Py_GETENV("OEPYTHON3HOME");
  27. + if (!chome)
  28. + chome = Py_GETENV("PYTHONHOME");
  29. if (chome) {
  30. size_t size = Py_ARRAY_LENGTH(env_home);
  31. size_t r = mbstowcs(env_home, chome, size);