mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
setup_path_on_import: Don’t re-add BASE_DIR to sys.path.
BASE_DIR must already be in sys.path if we got as far as importing this. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
8fdb62a6bc
commit
e4832cc9da
@@ -1,6 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Use libraries from a virtualenv (by modifying sys.path) in production.
|
Use libraries from a virtualenv (by modifying sys.path) in production.
|
||||||
Also add Zulip's root directory to sys.path
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -17,5 +16,3 @@ if sys.prefix != venv:
|
|||||||
exec(open(activate_this).read(), {}, activate_locals)
|
exec(open(activate_this).read(), {}, activate_locals)
|
||||||
if not os.path.exists(activate_locals["site_packages"]):
|
if not os.path.exists(activate_locals["site_packages"]):
|
||||||
raise RuntimeError(venv + " was not set up for this Python version")
|
raise RuntimeError(venv + " was not set up for this Python version")
|
||||||
|
|
||||||
sys.path.append(BASE_DIR)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user