🚨 Get rid of an "imp" deprecation warning
Our distutils import used to determine the current interpreter's site-packages directory caused an import warning. Switching to a different method of determining the path solved the error and is also way cleaner. Found here: https://stackoverflow.com/a/52638888
This commit is contained in:
1 parent
8d7ace50a3
commit
32943e191d
1 file changed
+2
-6
@@ -907,13 +907,9 @@ class PluginManager(object):
|
||||
|
||||
def _detect_python_environment(self):
|
||||
import sys
|
||||
from distutils.command.install import install as cmd_install
|
||||
from distutils.dist import Distribution
|
||||
import sysconfig
|
||||
|
||||
cmd = cmd_install(Distribution())
|
||||
cmd.finalize_options()
|
||||
|
||||
self._python_install_dir = cmd.install_lib
|
||||
self._python_install_dir = sysconfig.get_path("purelib")
|
||||
self._python_prefix = os.path.realpath(sys.prefix)
|
||||
self._python_virtual_env = hasattr(sys, "real_prefix") or (
|
||||
hasattr(sys, "base_prefix")
|
||||
|
||||
Reference in new issue
Block a user