public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Replace use of deprecated Python 'imp' module with 'importlib'
@ 2021-12-17 22:26 Thomas Schwinge
  2021-12-21 13:31 ` Dodji Seketeli
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2021-12-17 22:26 UTC (permalink / raw)
  To: libabigail; +Cc: Thomas Schwinge, Chenxiong Qi

In the test logs, I've found a number of:

    [...]/tests/mockfedabipkgdiff:42: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
      import imp

I've asked The Internet what to do about that, and this commit is the result.
But beware: I'm not a Python wizard.

	* tests/mockfedabipkgdiff.in: Replace use of deprecated Python
	'imp' module with 'importlib'.

CC: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
---
 tests/mockfedabipkgdiff.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/mockfedabipkgdiff.in b/tests/mockfedabipkgdiff.in
index e775526e..7de42b86 100644
--- a/tests/mockfedabipkgdiff.in
+++ b/tests/mockfedabipkgdiff.in
@@ -39,7 +39,7 @@ variables.
 
 import os
 import tempfile
-import imp
+import importlib
 import six
 
 try:
@@ -70,7 +70,7 @@ def get_download_dir():
 
 
 # Import the fedabipkgdiff program file from the source directory.
-fedabipkgdiff_mod = imp.load_source('fedabipkgdiff', FEDABIPKGDIFF)
+fedabipkgdiff_mod = importlib.machinery.SourceFileLoader('fedabipkgdiff', FEDABIPKGDIFF).load_module()
 
 
 # -----------------  Koji resource storage begins ------------------
-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-06 14:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 22:26 [PATCH] Replace use of deprecated Python 'imp' module with 'importlib' Thomas Schwinge
2021-12-21 13:31 ` Dodji Seketeli
2021-12-21 13:43   ` Mark Wielaard
2021-12-21 14:04     ` [PATCH] Replace Python 'import importlib' with 'import importlib.machinery' Thomas Schwinge
2021-12-21 15:06       ` Dodji Seketeli
2021-12-21 15:43         ` Mark Wielaard
2021-12-21 16:19           ` Thomas Schwinge
2021-12-21 19:41             ` [PATCH] Handle several variants of Python 'imp', 'importlib' modules Thomas Schwinge
2022-01-03 16:33               ` Dodji Seketeli
2022-01-05 15:32                 ` Thomas Schwinge
2022-01-06 14:44                   ` Dodji Seketeli
2022-01-04 14:51               ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).