Skip to content

Commit 47102c3

Browse files
committed
Don't use deprecated distutils module.
1 parent 10315a6 commit 47102c3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import glob
22
import os
3+
import sysconfig
34
from subprocess import Popen, PIPE
4-
from distutils import sysconfig
55

66
Import('env')
77

@@ -14,11 +14,15 @@ def call(cmd, silent=True):
1414

1515

1616
prefix = env['PREFIX']
17-
target_path = os.path.normpath(sysconfig.get_python_lib() + os.path.sep + env['MAPNIK_NAME'])
17+
if "deb_system" in sysconfig.get_scheme_names():
18+
python_modules_dir = sysconfig.get_path("purelib", "deb_system")
19+
else:
20+
python_modules_dir = sysconfig.get_path("purelib")
21+
target_path = os.path.normpath(python_modules_dir + os.path.sep + env['MAPNIK_NAME'])
1822

1923
py_env = env.Clone()
2024

21-
py_env.Append(CPPPATH = sysconfig.get_python_inc())
25+
py_env.Append(CPPPATH = sysconfig.get_path('include'))
2226

2327
py_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
2428

0 commit comments

Comments
 (0)