diff --git a/gef.py b/gef.py index 94cd9e2cf..0abc0b484 100644 --- a/gef.py +++ b/gef.py @@ -9949,8 +9949,8 @@ def load_plugins_from_directory(plugin_directory: pathlib.Path): def load_virtualenv(self, new_path: Optional[pathlib.Path] = None): path = new_path or gef.config["gef.virtualenv_path"] - activate_script_path = pathlib.Path(path) / "bin" / "activate_this.py" if path: + activate_script_path = pathlib.Path(path)/"bin"/"activate_this.py" exec(open(activate_script_path).read(), {'__file__': activate_script_path}) @property