0001-use-sysconfig-get_path-instead-of-get_python_lib.patch 1.2 KB

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