Message ID | 20211221140432.2159710-1-thomas@codesourcery.com |
---|---|
State | Committed |
Headers |
Return-Path: <libabigail-bounces+patchwork=sourceware.org@sourceware.org> 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 7F873385843A for <patchwork@sourceware.org>; Tue, 21 Dec 2021 14:04:54 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.44]) by sourceware.org (Postfix) with ESMTPS id 7A5AA3858C2C for <libabigail@sourceware.org>; Tue, 21 Dec 2021 14:04:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A5AA3858C2C 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 smtprelay02.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <outgoing@schwinge.name>) id 1mzfkS-00015t-Ip; Tue, 21 Dec 2021 15:04:12 +0100 Received: (nullmailer pid 2159774 invoked by uid 1000); Tue, 21 Dec 2021 14:04:47 -0000 From: Thomas Schwinge <thomas@codesourcery.com> To: libabigail@sourceware.org Subject: [PATCH] Replace Python 'import importlib' with 'import importlib.machinery' Date: Tue, 21 Dec 2021 15:04:32 +0100 Message-Id: <20211221140432.2159710-1-thomas@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <660b800832668cba9415c01d7cf5ab49438dba98.camel@klomp.org> References: <660b800832668cba9415c01d7cf5ab49438dba98.camel@klomp.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_H3, RCVD_IN_MSPIKE_WL, 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 <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> Cc: Mark Wielaard <mark@klomp.org>, Thomas Schwinge <thomas@codesourcery.com> Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" <libabigail-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Replace Python 'import importlib' with 'import importlib.machinery'
|
|
Commit Message
Thomas Schwinge
Dec. 21, 2021, 2:04 p.m. UTC
Fix-up for recent commit f0582fdbf1267f0f34bf3c3b6698b60026410146 "Replace use of deprecated Python 'imp' module with 'importlib'", which... [...] seems to have broken something on centos7 x86_64: https://builder.wildebeest.org/buildbot/#/changes/7273 File "/srv/buildbot/worker/libabigail-centos-x86_64/build/tests/mockfedabipkgdiff", line 73, in <module> fedabipkgdiff_mod = importlib.machinery.SourceFileLoader('fedabipkgdiff', FEDABIPKGDIFF).load_module() AttributeError: 'module' object has no attribute 'machinery' Again, I've asked The Internet what to do about that, and this commit is the result. But beware: I'm still not a Python wizard. * tests/mockfedabipkgdiff.in: Replace Python 'import importlib' with 'import importlib.machinery'. --- tests/mockfedabipkgdiff.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Thomas Schwinge <thomas@codesourcery.com> a écrit: > Fix-up for recent commit f0582fdbf1267f0f34bf3c3b6698b60026410146 > "Replace use of deprecated Python 'imp' module with 'importlib'", which... > > [...] seems to have broken something on centos7 x86_64: > > https://builder.wildebeest.org/buildbot/#/changes/7273 > > File "/srv/buildbot/worker/libabigail-centos-x86_64/build/tests/mockfedabipkgdiff", line 73, in <module> > fedabipkgdiff_mod = importlib.machinery.SourceFileLoader('fedabipkgdiff', FEDABIPKGDIFF).load_module() > AttributeError: 'module' object has no attribute 'machinery' > > Again, I've asked The Internet what to do about that, and this commit is the > result. But beware: I'm still not a Python wizard. > > * tests/mockfedabipkgdiff.in: Replace Python 'import importlib' > with 'import importlib.machinery'. Applied to master. Cheers,
Hi, On Tue, 2021-12-21 at 16:06 +0100, Dodji Seketeli wrote: > Thomas Schwinge <thomas@codesourcery.com> a écrit: > > > Fix-up for recent commit f0582fdbf1267f0f34bf3c3b6698b60026410146 > > "Replace use of deprecated Python 'imp' module with 'importlib'", > > which... > > > > [...] seems to have broken something on centos7 x86_64: > > > > https://builder.wildebeest.org/buildbot/#/changes/7273 > > > > File "/srv/buildbot/worker/libabigail-centos- > > x86_64/build/tests/mockfedabipkgdiff", line 73, in <module> > > fedabipkgdiff_mod = > > importlib.machinery.SourceFileLoader('fedabipkgdiff', > > FEDABIPKGDIFF).load_module() > > AttributeError: 'module' object has no attribute 'machinery' > > > > Again, I've asked The Internet what to do about that, and this > > commit is the > > result. But beware: I'm still not a Python wizard. > > > > * tests/mockfedabipkgdiff.in: Replace Python 'import importlib' > > with 'import importlib.machinery'. > > Applied to master. Sadly still failing: https://builder.wildebeest.org/buildbot/#/builders/8/builds/802 Note that this is a centos7 install with just python2 and there is no python3-koji, only python2-koji, which is needed to run the runtestfedabipkgdiff.py test. Maybe this test should just be disabled for python2 only systems? Cheers, Mark
Hi! On 2021-12-21T16:43:40+0100, Mark Wielaard <mark@klomp.org> wrote: > On Tue, 2021-12-21 at 16:06 +0100, Dodji Seketeli wrote: >> Thomas Schwinge <thomas@codesourcery.com> a écrit: >> > Fix-up for recent commit f0582fdbf1267f0f34bf3c3b6698b60026410146 >> > "Replace use of deprecated Python 'imp' module with 'importlib'", >> > which... >> > >> > [...] seems to have broken something on centos7 x86_64: >> > >> > https://builder.wildebeest.org/buildbot/#/changes/7273 >> > >> > File "/srv/buildbot/worker/libabigail-centos- >> > x86_64/build/tests/mockfedabipkgdiff", line 73, in <module> >> > fedabipkgdiff_mod = >> > importlib.machinery.SourceFileLoader('fedabipkgdiff', >> > FEDABIPKGDIFF).load_module() >> > AttributeError: 'module' object has no attribute 'machinery' >> > >> > Again, I've asked The Internet what to do about that, and this >> > commit is the >> > result. But beware: I'm still not a Python wizard. >> > >> > * tests/mockfedabipkgdiff.in: Replace Python 'import importlib' >> > with 'import importlib.machinery'. >> >> Applied to master. > > Sadly still failing: > https://builder.wildebeest.org/buildbot/#/builders/8/builds/802 I'm sorry for the repeated breakage. > Note that this is a centos7 install with just python2 Aha -- Python 2. And yes, I now see that I'm able to reproduce the problem with Python 2; I'll send another patch later. > and there is no > python3-koji, only python2-koji, which is needed to run the > runtestfedabipkgdiff.py test. Well, regarding that one, see my recent commit feb441e284a03f3ff86fd0962cfaf5a9efedf28d "fedabipkgdiff: Enable testing without proper Koji installation". ;-D > Maybe this test should just be disabled for python2 only systems? No. It use to work, and should continue to. Let me give it one more try... Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
diff --git a/tests/mockfedabipkgdiff.in b/tests/mockfedabipkgdiff.in index 7de42b86..29a28ad9 100644 --- a/tests/mockfedabipkgdiff.in +++ b/tests/mockfedabipkgdiff.in @@ -39,7 +39,7 @@ variables. import os import tempfile -import importlib +import importlib.machinery import six try: