From patchwork Fri Dec 17 22:26:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 49074 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDCDB3858420 for ; Fri, 17 Dec 2021 22:27:02 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by sourceware.org (Postfix) with ESMTPS id B7FB13858420 for ; Fri, 17 Dec 2021 22:26:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7FB13858420 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schwinge.name Received: from [192.94.31.2] (helo=dem-tschwing-1.ger.mentorg.com) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1myLgr-0001xP-87; Fri, 17 Dec 2021 23:27:01 +0100 Received: (nullmailer pid 2542067 invoked by uid 1000); Fri, 17 Dec 2021 22:26:55 -0000 From: Thomas Schwinge To: libabigail@sourceware.org Subject: [PATCH] Replace use of deprecated Python 'imp' module with 'importlib' Date: Fri, 17 Dec 2021 23:26:30 +0100 Message-Id: <20211217222631.2541972-1-thomas@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Df-Sender: b3V0Z29pbmdAc2Nod2luZ2UubmFtZQ== X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: Thomas Schwinge Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" 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 Signed-off-by: Thomas Schwinge --- 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 ------------------