diff options
| author | Josh Ferrell <josh@vector35.com> | 2023-02-09 18:57:43 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2023-02-09 18:58:12 -0500 |
| commit | 2290ef977455fe642c3df86a879e3645b7e43eb3 (patch) | |
| tree | a2f64d68a9f68a7353738757fc614320b627a0ac /python | |
| parent | e71d12a6147d0a2dfe6ead94d31db30d36792087 (diff) | |
Invalidate python finder caches when plugin dependency gets installed
Diffstat (limited to 'python')
| -rw-r--r-- | python/scriptingprovider.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 62462bdf..ccbe95c3 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -18,17 +18,19 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +import abc import code -import traceback import ctypes -from ctypes.util import find_library -import threading -import abc -import sys +import importlib +import os +import re import subprocess +import sys +import threading +import traceback + +from ctypes.util import find_library from pathlib import Path -import re -import os from typing import Generator, Optional, List, Tuple from typing import Type as TypeHintType @@ -1393,7 +1395,9 @@ class PythonScriptingProvider(ScriptingProvider): args.extend(list(filter(len, modules.split("\n")))) log_info(f"Running pip {args}") status, result = self._run_args(args) - if not status: + if status: + importlib.invalidate_caches() + else: log_error(f"Error while attempting to install requirements {result}") return status |
