Skip to content

Commit acbf673

Browse files
committed
Remove distutils uses no longer available in python 3.12
1 parent fe8e455 commit acbf673

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

preditor/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import absolute_import
22

33
import logging
4+
import shutil
45
import sys
5-
from distutils.spawn import find_executable
66

77
import click
88
from click.core import ParameterSource
@@ -129,7 +129,7 @@ def shortcut(path, public, name, target, args, description):
129129

130130
# Resolve the full path to the preditor exe.
131131
if target in ("preditor", "preditorw"):
132-
target = find_executable(target)
132+
target = shutil.which(target)
133133

134134
parameter_source = click.get_current_context().get_parameter_source('name')
135135
if parameter_source == ParameterSource.DEFAULT:

preditor/osystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def getPointerSize():
3838
def pythonPath(pyw=False, architecture=None):
3939
if settings.OS_TYPE != 'Windows':
4040
return 'python'
41-
from distutils.sysconfig import get_python_inc
41+
import sysconfig
4242

4343
# Unable to pull the path from the registry just use the current python path
44-
basepath = os.path.split(get_python_inc())[0]
44+
basepath = os.path.split(sysconfig.get_path('include'))[0]
4545
# build the path to the python executable. If requested use pythonw instead of
4646
# python
4747
return os.path.join(basepath, 'python{w}.exe'.format(w=pyw and 'w' or ''))

0 commit comments

Comments
 (0)