[jhbuild/wip/path-env: 20/22] python path: work around a bug in a Fedora patch



commit 2e8ccdb0d18d268c78de8b8b0497ac9a99ccc4bb
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Mar 13 23:49:43 2014 -0400

    python path: work around a bug in a Fedora patch
    
    The Fedora python package patches the get_python_lib() function in
    distutils.sysconfig, breaking its API by returning different values,
    depending on plat_specific, even if prefix is given.
    
    See https://bugzilla.redhat.com/show_bug.cgi?id=1076293.
    
    Work around that by checking for the different path and adding it to the
    path as well.

 jhbuild/sitecustomize/sitecustomize.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/sitecustomize/sitecustomize.py b/jhbuild/sitecustomize/sitecustomize.py
index f1b7e28..4ae2a77 100644
--- a/jhbuild/sitecustomize/sitecustomize.py
+++ b/jhbuild/sitecustomize/sitecustomize.py
@@ -11,3 +11,10 @@ if 'JHBUILD_PREFIXES' in os.environ:
             sys.path.remove(sitedir)
 
         sys.path.insert(1, sitedir)
+
+        # work around https://bugzilla.redhat.com/show_bug.cgi?id=1076293
+        sitedir2 = sysconfig.get_python_lib(1, prefix=prefix)
+        if sitedir2 != sitedir:
+            if sitedir2 in sys.path:
+                sys.path.remove(sitedir2)
+            sys.path.insert(1, sitedir2)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]