Commit 7101034b authored by Seppo Yli-Olli's avatar Seppo Yli-Olli

Turned out this fixes Python2 too

parent 61d8ccfb
Pipeline #62073703 passed with stages
in 131 minutes and 47 seconds
......@@ -6,11 +6,11 @@ depends:
config:
install-commands:
- |
install -m 644 -D python2-sitecustomize.py "%{install-root}%{indep-libdir}/python2.7/sitecustomize.py"
install -m 644 -D python3-sitecustomize.py "%{install-root}%{indep-libdir}/python2.7/sitecustomize.py"
python2 -m compileall "%{install-root}%{indep-libdir}/python2.7/sitecustomize.py"
python2 -O -m compileall "%{install-root}%{indep-libdir}/python2.7/sitecustomize.py"
python2 -OO -m compileall "%{install-root}%{indep-libdir}/python2.7/sitecustomize.py"
sources:
- kind: local
path: files/python2-sitecustomize.py
path: files/python3-sitecustomize.py
import sys
import site
import os
import sysconfig
old_user_site = os.path.abspath(site.USER_SITE)
site.USER_SITE = None
site.USER_BASE = os.environ.setdefault("PYTHONUSERBASE", "/var/data/python")
sysconfig._CONFIG_VARS = None
site.USER_SITE = site.getusersitepackages()
old_index = sys.path.index(old_user_site)
sys.path.remove(old_user_site)
sys.path.insert(old_index, os.path.abspath(site.USER_SITE))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment