mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
variety: patch to fix for Python 3.12.
This commit is contained in:
parent
c4bab26a88
commit
8152ce7de4
2 changed files with 37 additions and 1 deletions
36
srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch
Normal file
36
srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
--- a/jumble/Jumble.py
|
||||||
|
+++ b/jumble/Jumble.py
|
||||||
|
@@ -14,7 +14,8 @@
|
||||||
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
### END LICENSE
|
||||||
|
|
||||||
|
-import imp
|
||||||
|
+import importlib.util
|
||||||
|
+import sys
|
||||||
|
import inspect
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
@@ -39,13 +40,16 @@
|
||||||
|
for location, f in self._walk_python_files():
|
||||||
|
path = os.path.join(location, f)
|
||||||
|
name = os.path.splitext(f)[0]
|
||||||
|
- info = imp.find_module(name, [location])
|
||||||
|
- try:
|
||||||
|
- logger.info(lambda: "Jumble loading module in %s from %s" % (name, path))
|
||||||
|
- yield imp.load_module(name, *info), path
|
||||||
|
- except Exception:
|
||||||
|
- logger.exception("Could not load plugin module %s" % path)
|
||||||
|
- continue
|
||||||
|
+ if (spec := importlib.util.spec_from_file_location(name, path)) is not None:
|
||||||
|
+ try:
|
||||||
|
+ module = importlib.util.module_from_spec(spec)
|
||||||
|
+ logger.info(lambda: "Jumble loading module in %s from %s" % (name, path))
|
||||||
|
+ sys.modules[name] = module
|
||||||
|
+ spec.loader.exec_module(module)
|
||||||
|
+ yield module, path
|
||||||
|
+ except Exception:
|
||||||
|
+ logger.exception("Could not load plugin module %s" % path)
|
||||||
|
+ continue
|
||||||
|
|
||||||
|
def _walk_plugin_classes(self):
|
||||||
|
for module, path in self._walk_modules():
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'variety'
|
# Template file for 'variety'
|
||||||
pkgname=variety
|
pkgname=variety
|
||||||
version=0.8.10
|
version=0.8.10
|
||||||
revision=2
|
revision=3
|
||||||
build_style=python3-module
|
build_style=python3-module
|
||||||
pycompile_dirs="usr/share/variety/plugins"
|
pycompile_dirs="usr/share/variety/plugins"
|
||||||
hostmakedepends="python3-setuptools python3-distutils-extra intltool"
|
hostmakedepends="python3-setuptools python3-distutils-extra intltool"
|
||||||
|
|
Loading…
Add table
Reference in a new issue