summarylogtreecommitdiffstats
path: root/python3.12-compatibility.patch
diff options
context:
space:
mode:
Diffstat (limited to 'python3.12-compatibility.patch')
-rw-r--r--python3.12-compatibility.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/python3.12-compatibility.patch b/python3.12-compatibility.patch
new file mode 100644
index 000000000000..5e67b1bee5ba
--- /dev/null
+++ b/python3.12-compatibility.patch
@@ -0,0 +1,49 @@
+diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/setup.py cmake-lint-1.4.2/setup.py
+--- cmake-lint-1.4.2.orig/setup.py 2024-04-22 15:48:16.433625415 +0200
++++ cmake-lint-1.4.2/setup.py 2024-04-22 15:59:27.546256097 +0200
+@@ -1,22 +1,13 @@
+ #! /usr/bin/env python
+
+-import imp
++from importlib.machinery import SourceFileLoader
+
+ from setuptools import setup
+
+
+ def get_version():
+- ver_file = None
+- try:
+- ver_file, pathname, description = imp.find_module(
+- '__version__', ['cmakelint'])
+- vermod = imp.load_module(
+- '__version__', ver_file, pathname, description)
+- version = vermod.VERSION
+- return version
+- finally:
+- if ver_file is not None:
+- ver_file.close()
++ version_module = SourceFileLoader('__version__', 'cmakelint/__version__.py').load_module()
++ return version_module.VERSION
+
+
+ def read_without_comments(filename):
+@@ -30,7 +21,6 @@
+ setup(name='cmakelint',
+ version=get_version(),
+ packages=['cmakelint'],
+- scripts=['bin/cmakelint'],
+ entry_points={
+ 'console_scripts': [
+ 'cmakelint = cmakelint.main:main'
+diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/test/cmakelint_test.py cmake-lint-1.4.2/test/cmakelint_test.py
+--- cmake-lint-1.4.2.orig/test/cmakelint_test.py 2024-04-22 15:48:16.433625415 +0200
++++ cmake-lint-1.4.2/test/cmakelint_test.py 2024-04-22 15:59:27.539589434 +0200
+@@ -19,7 +19,7 @@
+
+ import cmakelint.__version__
+ import cmakelint.main
+-import mock
++from unittest import mock
+
+
+ # stderr suppression from https://stackoverflow.com/a/1810086