diff options
author | Thomas O'Donnell <andytom@users.noreply.github.com> | 2019-11-02 12:10:21 +0100 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-11-02 20:10:21 +0900 |
commit | 42f6868e3ff3dbf47e8a2c741a325cfc0a8486a7 (patch) | |
tree | cadd2283c66f067d81b7369e37d708ba8faaa093 /src/modules/python.rs | |
parent | fa1267f12f60510d6214476e3d059edcb861f0c8 (diff) |
feat: Enable the python module in virtual envs (#584)
This will enable the python module when a virtual environment has been
activated, this is detected via the `VIRTUAL_ENV` env var.
Diffstat (limited to 'src/modules/python.rs')
-rw-r--r-- | src/modules/python.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/python.rs b/src/modules/python.rs index 99ab78e46..491ad89a2 100644 --- a/src/modules/python.rs +++ b/src/modules/python.rs @@ -27,7 +27,9 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { .set_extensions(&["py"]) .is_match(); - if !is_py_project { + let is_venv = env::var("VIRTUAL_ENV").ok().is_some(); + + if !is_py_project && !is_venv { return None; } |