Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alpine
aports
Commits
105c014d
Commit
105c014d
authored
9 months ago
by
Oliver Smith
Committed by
Patrycja Rosa
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
community/gpodder-adaptive: fix python 3.12 compat
parent
1a000a58
No related branches found
No related tags found
1 merge request
!65216
community/gpodder{,-adaptive}: fix python 3.12 compat
Pipeline
#231415
canceled
9 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
community/gpodder-adaptive/0001-Replace-the-removed-imp-module-with-importlib.patch
+47
-0
47 additions, 0 deletions
.../0001-Replace-the-removed-imp-module-with-importlib.patch
community/gpodder-adaptive/APKBUILD
+4
-2
4 additions, 2 deletions
community/gpodder-adaptive/APKBUILD
with
51 additions
and
2 deletions
community/gpodder-adaptive/0001-Replace-the-removed-imp-module-with-importlib.patch
0 → 100644
+
47
−
0
View file @
105c014d
From dd9b594d24a541c0f1d3b096e47b6d7f1c11ca7e Mon Sep 17 00:00:00 2001
From: auouymous <au@qzx.com>
Date: Fri, 20 Oct 2023 03:03:01 -0600
Subject: [PATCH] Replace the removed imp module with importlib.
---
src/gpodder/extensions.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/gpodder/extensions.py b/src/gpodder/extensions.py
index 8f50ff31..44fc35d5 100644
--- a/src/gpodder/extensions.py
+++ b/src/gpodder/extensions.py
@@ -31,7 +31,7 @@
For an example extension see share/gpodder/examples/extensions.py
import functools
import glob
-import imp
+import importlib
import logging
import os
import re
@@ -291,15 +291,16 @@
class ExtensionContainer(object):
self.name, self.metadata.only_for)
return
- basename, extension = os.path.splitext(os.path.basename(self.filename))
- fp = open(self.filename, 'r')
+ basename, _ = os.path.splitext(os.path.basename(self.filename))
try:
- module_file = imp.load_module(basename, fp, self.filename,
- (extension, 'r', imp.PY_SOURCE))
+ # from load_source() on https://docs.python.org/dev/whatsnew/3.12.html
+ loader = importlib.machinery.SourceFileLoader(basename, self.filename)
+ spec = importlib.util.spec_from_file_location(basename, self.filename, loader=loader)
+ module_file = importlib.util.module_from_spec(spec)
+ loader.exec_module(module_file)
finally:
# Remove the .pyc file if it was created during import
util.delete_file(self.filename + 'c')
- fp.close()
self.default_config = getattr(module_file, 'DefaultConfig', {})
if self.default_config:
--
2.45.0
This diff is collapsed.
Click to expand it.
community/gpodder-adaptive/APKBUILD
+
4
−
2
View file @
105c014d
...
...
@@ -3,7 +3,7 @@
pkgname
=
gpodder-adaptive
pkgver
=
3.11.4
_plusver
=
1
pkgrel
=
1
pkgrel
=
2
pkgdesc
=
"Podcast aggregator (adaptive version)"
url
=
"https://github.com/gpodder/gpodder/tree/adaptive"
arch
=
"all !s390x !riscv64"
# blocked by adwaita-icon-theme
...
...
@@ -24,7 +24,8 @@ depends="
makedepends
=
"py3-setuptools intltool help2man"
checkdepends
=
"py3-pytest py3-pytest-httpserver py3-pytest-cov py3-minimock desktop-file-utils"
subpackages
=
"
$pkgname
-doc
$pkgname
-lang
$pkgname
-pyc"
source
=
"gpodder-adaptive-
$pkgver
+
$_plusver
.tar.gz::https://github.com/gpodder/gpodder/archive/refs/tags/adaptive/
$pkgver
+
$_plusver
.tar.gz"
source
=
"gpodder-adaptive-
$pkgver
+
$_plusver
.tar.gz::https://github.com/gpodder/gpodder/archive/refs/tags/adaptive/
$pkgver
+
$_plusver
.tar.gz
0001-Replace-the-removed-imp-module-with-importlib.patch"
builddir
=
"
$srcdir
/gpodder-adaptive-
$pkgver
-
$_plusver
"
check
()
{
...
...
@@ -40,4 +41,5 @@ package() {
sha512sums
=
"
c5920a74abd8deecdbf0a643cdf9ff818e3f5c220195d6a658627ff1856fc4a7c7bcac98fe4dd2efa576388219d0dd3a37bf1156f33d39a13eab96bccf321dee gpodder-adaptive-3.11.4+1.tar.gz
ae5383aaed6e67f582d9dff2e2aaba3735022578bc6b7de525fec7cc456d67ad01197ed41a4f5046d3774d5bc3b884ab65f066c7f3a78fd7e023106176f32870 0001-Replace-the-removed-imp-module-with-importlib.patch
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment