From fd415a3613fad872062fb7cb4e271ac1476402ef Mon Sep 17 00:00:00 2001 From: Adam Duskett Date: Tue, 24 Oct 2023 08:47:12 +0200 Subject: [PATCH] python 3.12.0 support Distutils has been removed from python 3.12.0. Use sysconfig.get_path instead of get_python_lib. --- iptc/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iptc/util.py b/iptc/util.py index 04fe905..94befc5 100644 --- a/iptc/util.py +++ b/iptc/util.py @@ -3,7 +3,7 @@ import sys import ctypes import ctypes.util -from distutils.sysconfig import get_python_lib +import sysconfig from itertools import product from subprocess import Popen, PIPE from sys import version_info @@ -64,7 +64,7 @@ def _do_find_library(name): # probably we have been installed in a virtualenv try: - lib = ctypes.CDLL(os.path.join(get_python_lib(), name), + lib = ctypes.CDLL(os.path.join(sysconfig.get_path("purelib"), name), mode=ctypes.RTLD_GLOBAL) return lib except: