From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2DB8E138252 for ; Tue, 10 May 2016 22:13:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8842EE0863; Tue, 10 May 2016 22:13:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 30922E0863 for ; Tue, 10 May 2016 22:13:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 05BE1340B35 for ; Tue, 10 May 2016 22:13:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0038B336 for ; Tue, 10 May 2016 22:13:17 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1462918322.90fe6724d0a8d1ebfe6443dee118432e20432b8b.dolsen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/module.py X-VCS-Directories: layman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 90fe6724d0a8d1ebfe6443dee118432e20432b8b X-VCS-Branch: master Date: Tue, 10 May 2016 22:13:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8eeb4963-3f89-425d-956d-20587a081388 X-Archives-Hash: dc1897f435e7ba6d28b9d4445ff64ce2 commit: 90fe6724d0a8d1ebfe6443dee118432e20432b8b Author: Brian Dolbec gentoo org> AuthorDate: Tue May 10 22:12:02 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Tue May 10 22:12:02 2016 +0000 URL: https://gitweb.gentoo.org/proj/layman.git/commit/?id=90fe6724 layman/module.py: Fix commit 63808ef00f94 mis-applied 'sourcefile' attribute changes It was not looking for the 'sourcefile' attribute first, then falling back to the kidname for backward compatibility. It was incorrectly looking for an ImportError, instead of a 'sourcefile' KeyError. The filepath of the affected file for the error message had an extra leading '_'. Add the module name to the warning message. layman/module.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/layman/module.py b/layman/module.py index 08bcbc2..092418f 100644 --- a/layman/module.py +++ b/layman/module.py @@ -49,13 +49,14 @@ class Module(object): kid = self.module_spec['provides'][submodule] kidname = kid['name'] try: + kid['module_name'] = '.'.join([mod_name, kid['sourcefile']]) + except KeyError: kid['module_name'] = '.'.join([mod_name, kidname]) - except ImportError: - kid['module_name'] = '.'.join([mod_name, self.name]) - f = self.__module.__file__ - msg = 'Module.__initialize(); module spec is old, missing '\ + f = self._module.__file__ + msg = 'Module.__initialize(); %(module)s module spec is old, missing '\ 'attribute: \'sourcefile\'.\nBackward compatibility '\ - 'may be removed in the future.\nFile: %(f)s' % {'f': f} + 'may be removed in the future.\nFile: %(f)s' % { + 'module': self.name, 'f': f} self.output.warn(msg) kid['is_imported'] = False self.kids[kidname] = kid