mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
setup_path_on_import: Check that the virtualenv is compatible.
The site_packages variable points to (e.g.) zulip-py3-venv/lib/python3.4/site-packages. If that doesn’t exist, we’re probably running the wrong Python version. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
7a58f574bf
commit
b9f7b08af2
@@ -15,5 +15,7 @@ if sys.prefix != venv:
|
||||
if os.path.exists(activate_this):
|
||||
activate_locals = dict(__file__=activate_this)
|
||||
exec(open(activate_this).read(), {}, activate_locals)
|
||||
if not os.path.exists(activate_locals["site_packages"]):
|
||||
raise RuntimeError(venv + " was not set up for this Python version")
|
||||
|
||||
sys.path.append(BASE_DIR)
|
||||
|
||||
Reference in New Issue
Block a user