diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-03-01 15:24:26 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-03-02 07:50:56 -0500 |
| commit | 00e377a3d7ba40c80a4646453de07a1d2c7a27a6 (patch) | |
| tree | 312a6f6dd19966fa0695608b2ea342bd5ce34789 /python | |
| parent | 0e3c45718836b7b2af8cb8873831483de42b01b4 (diff) | |
Check if in virtualenv before dependency installation
Diffstat (limited to 'python')
| -rw-r--r-- | python/scriptingprovider.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 3205826b..fea6b218 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -28,6 +28,7 @@ import sys import subprocess from pathlib import Path, PurePath import re +import os # Binary Ninja components import binaryninja @@ -936,7 +937,8 @@ class PythonScriptingProvider(ScriptingProvider): args.append("install") args.append("--verbose") venv = Settings().get_string("python.virtualenv") - if venv is not None and venv.endswith("site-packages") and Path(venv).is_dir(): + in_virtual_env = 'VIRTUAL_ENV' in os.environ + if venv is not None and venv.endswith("site-packages") and Path(venv).is_dir() and not in_virtual_env: args.extend(["--target", venv]) args.extend(filter(len, modules.decode("utf-8").split("\n"))) |
