Merge ~pushkarnk/ubuntu/+source/glueviz:fix-2052370 into ubuntu/+source/glueviz:ubuntu/devel

Proposed by Pushkar Kulkarni
Status: Merged
Merged at revision: 52c1ba5a86dfaf3d6c3b441bcef5f5ddb15b32b2
Proposed branch: ~pushkarnk/ubuntu/+source/glueviz:fix-2052370
Merge into: ubuntu/+source/glueviz:ubuntu/devel
Diff against target: 78 lines (+46/-1)
4 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/patches/Replace-imp-by-importlib.patch (+37/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Graham Inggs (community) Approve
git-ubuntu import Pending
Review via email: mp+459975@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Graham Inggs (ginggs) wrote :

Looks good to me, sponsored.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index ee04792..f668b47 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+glueviz (1.0.1+dfsg-3ubuntu1) noble; urgency=medium
7+
8+ * Migrate from imp to importlib for Python 3.12 (LP: #2052370)
9+
10+ -- Pushkar Kulkarni <pushkar.kulkarni@canonical.com> Sun, 04 Feb 2024 02:37:00 +0530
11+
12 glueviz (1.0.1+dfsg-3) unstable; urgency=medium
13
14 * Team upload.
15diff --git a/debian/control b/debian/control
16index ad9fa0d..adab6f6 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -1,5 +1,6 @@
20 Source: glueviz
21-Maintainer: Debian Astronomy Maintainers <debian-astro-maintainers@lists.alioth.debian.org>
22+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
23+XSBC-Original-Maintainer: Debian Astronomy Maintainers <debian-astro-maintainers@lists.alioth.debian.org>
24 Uploaders: Josue Ortega <josue@debian.org>
25 Section: science
26 Priority: optional
27diff --git a/debian/patches/Replace-imp-by-importlib.patch b/debian/patches/Replace-imp-by-importlib.patch
28new file mode 100644
29index 0000000..93b3149
30--- /dev/null
31+++ b/debian/patches/Replace-imp-by-importlib.patch
32@@ -0,0 +1,37 @@
33+Author: Pushkar Kulkarni <pushkar.kulkarni@canonical.com>
34+Description: The "imp" package lets users implement the import statement,
35+ enabling dynamic loading of Python modules. The "imp" package was
36+ deprecated in an earlier version and removed in Python 3.12. The
37+ Python3 docs recommend moving to package "importlib" as a replacement.
38+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/glueviz/+bug/2052370
39+--- a/glue/config.py
40++++ b/glue/config.py
41+@@ -1,8 +1,10 @@
42+ import os
43+-import imp
44++import importlib
45+ import sys
46++import types
47+ import warnings
48+ from collections import namedtuple
49++from importlib.machinery import SourceFileLoader
50+
51+ from glue.utils import format_choices
52+
53+@@ -994,13 +996,14 @@
54+ Exception, if no module was found
55+ """
56+ search_order = search_path or _default_search_order()
57+- result = imp.new_module('config')
58++ # create a new, empty module
59++ result = types.ModuleType('config')
60+
61+ for config_file in search_order:
62+ dir = os.path.dirname(config_file)
63+ try:
64+ sys.path.append(dir)
65+- config = imp.load_source('config', config_file)
66++ config = SourceFileLoader('config', config_file).load_module()
67+ result = config
68+ except IOError:
69+ pass
70diff --git a/debian/patches/series b/debian/patches/series
71index 14a4a22..9e89a04 100644
72--- a/debian/patches/series
73+++ b/debian/patches/series
74@@ -4,3 +4,4 @@ Install-in-proper-directory-.txt-file.patch
75 Add-Keywords-to-desktop-file.patch
76 Install-under-the-right-directory-the-package-data.patch
77 Pass-int-argument-to-QProgressBar.setValue.patch
78+Replace-imp-by-importlib.patch

Subscribers

People subscribed via source and target branches