Skip to content

Commit 794aace

Browse files
Make python-iptables compatible with python 3.12 (#351)
1 parent d9a70d4 commit 794aace

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

iptc/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sys
44
import ctypes
55
import ctypes.util
6-
from distutils.sysconfig import get_python_lib
76
from itertools import product
87
from subprocess import Popen, PIPE
98
from sys import version_info
@@ -14,6 +13,12 @@ def get_config_var(name):
1413
if name == 'SO':
1514
return '.so'
1615
raise Exception('Not implemented')
16+
try:
17+
from distutils.sysconfig import get_python_lib
18+
except ModuleNotFoundError:
19+
import sysconfig
20+
def get_python_lib():
21+
return sysconfig.get_path("purelib")
1722

1823

1924
def _insert_ko(modprobe, modname):

iptc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22

33
__pkgname__ = "python-iptables"
4-
__version__ = "1.0.2-dev"
4+
__version__ = "1.1.0"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""python-iptables setup script"""
44

55
from setuptools import setup, Extension
6-
#from distutils.core import setup, Extension
76

87
# make pyflakes happy
98
__pkgname__ = None

0 commit comments

Comments
 (0)