Commit 61d8ccfb authored by Seppo Yli-Olli's avatar Seppo Yli-Olli

Properly fix

parent 85bcceef
......@@ -2,15 +2,15 @@ import sys
import site
import os
old_user_site = os.path.abspath(site.USER_SITE)
try:
old_index = sys.path.index(old_user_site)
except ValueError:
# Unknon what causes this but let's not do anything if this happens
getusersitepackages = site.getusersitepackages
except AttributeError:
# Probably virtualenv. Don't do anything
pass
else:
old_user_site = getusersitepackages()
site.USER_BASE = os.environ.get("PYTHONUSERBASE", "/var/data/python")
sys.path.remove(old_user_site)
site.USER_SITE = None
sys.path.insert(old_index, site.getusersitepackages())
site.USER_SITE = getusersitepackages()
sys.path = [item for item in sys.path if not item.startswith(old_user_site)]
site.addusersitepackages(site.removeduppaths())
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