1From fd415a3613fad872062fb7cb4e271ac1476402ef Mon Sep 17 00:00:00 2001
2From: Adam Duskett <adam.duskett@amarulasolutions.com>
3Date: Tue, 24 Oct 2023 08:47:12 +0200
4Subject: [PATCH] use sysconfig.get_path instead of get_python_lib
5
6Distutils has been removed from python 3.12.0. Use sysconfig.get_path instead
7of get_python_lib.
8
9Upstream: https://github.com/ldx/python-iptables/pull/340
10
11Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
12---
13 iptc/util.py | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/iptc/util.py b/iptc/util.py
17index 04fe905..94befc5 100644
18--- a/iptc/util.py
19+++ b/iptc/util.py
20@@ -3,7 +3,7 @@ import os
21 import sys
22 import ctypes
23 import ctypes.util
24-from distutils.sysconfig import get_python_lib
25+import sysconfig
26 from itertools import product
27 from subprocess import Popen, PIPE
28 from sys import version_info
29@@ -64,7 +64,7 @@ def _do_find_library(name):
30
31     # probably we have been installed in a virtualenv
32     try:
33-        lib = ctypes.CDLL(os.path.join(get_python_lib(), name),
34+        lib = ctypes.CDLL(os.path.join(sysconfig.get_path("purelib"), name),
35                           mode=ctypes.RTLD_GLOBAL)
36         return lib
37     except:
38--
392.41.0
40
41