From f218ebe648eef2f87d7a986270c2793a69d2e9ea Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Sep 12 2023 22:20:20 +0000 Subject: Fix a ModuleNotFoundError when this package was imported on Python 3.12+ Fixes https://bugzilla.redhat.com/2238632 --- diff --git a/Remove-the-import-of-imp.find_module.patch b/Remove-the-import-of-imp.find_module.patch new file mode 100644 index 0000000..f30106a --- /dev/null +++ b/Remove-the-import-of-imp.find_module.patch @@ -0,0 +1,27 @@ +From febce73af0b529b99b8e0e05c257ec1209e968c8 Mon Sep 17 00:00:00 2001 +From: Toshio Kuratomi +Date: Sun, 12 Jun 2022 19:23:55 -0700 +Subject: [PATCH] Remove the import of imp.find_module. + +Usage of find_module has been replaced by importlib. + +The imp module is going to be removed in python 3.12 +--- + straight/plugin/loaders.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/straight/plugin/loaders.py b/straight/plugin/loaders.py +index 8d628c2..1de996c 100644 +--- a/straight/plugin/loaders.py ++++ b/straight/plugin/loaders.py +@@ -4,7 +4,6 @@ import sys + import os + + from importlib import import_module +-from imp import find_module + + from straight.plugin.manager import PluginManager + +-- +2.41.0 + diff --git a/python-straight-plugin.spec b/python-straight-plugin.spec index b6d1ec1..f79bf0c 100644 --- a/python-straight-plugin.spec +++ b/python-straight-plugin.spec @@ -1,6 +1,6 @@ Name: python-straight-plugin Version: 1.5.0 -Release: 22%{?dist} +Release: 23%{?dist} Summary: Python plugin loader License: BSD @@ -8,6 +8,12 @@ URL: https://github.com/ironfroggy/straight.plugin/ Source0: https://files.pythonhosted.org/packages/48/89/34ae6a87784d0b607af61c84a52c313c598f1d86ce5c1e9eb6da038fee5f/straight.plugin-%{version}.tar.gz +# Remove an unused import of imp.find_module +# The imp module was removed in Python 3.12 +# Fixes https://bugzilla.redhat.com/2238632 +# Rebased from https://github.com/ironfroggy/straight.plugin/pull/30 +Patch: Remove-the-import-of-imp.find_module.patch + BuildArch: noarch BuildRequires: python3-devel @@ -47,7 +53,7 @@ themselves are modules in a namespace package where the namespace identifies the plugins in it for some particular purpose or intent. %prep -%setup -q -n straight.plugin-%{version} +%autosetup -p1 -n straight.plugin-%{version} 2to3 --write --nobackups . %build @@ -64,6 +70,10 @@ the plugins in it for some particular purpose or intent. %{python3_sitelib}/straight* %changelog +* Tue Sep 12 2023 Miro Hrončok - 1.5.0-23 +- Fix a ModuleNotFoundError when this package was imported on Python 3.12+ +- Fixes: rhbz#2238632 + * Fri Jul 21 2023 Fedora Release Engineering - 1.5.0-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild