From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9AD0B15800F for ; Tue, 17 Jan 2023 20:50:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9860DE085B; Tue, 17 Jan 2023 20:50:51 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7A05EE082B for ; Tue, 17 Jan 2023 20:50:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5A7F7340D58 for ; Tue, 17 Jan 2023 20:50:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CAB887DE for ; Tue, 17 Jan 2023 20:50:48 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1673988586.8384c20cc1b33a31ff1e49e61a4547c109b0d8e4.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/config/ X-VCS-Repository: proj/pkgcore/pkgcore X-VCS-Files: src/pkgcore/config/basics.py X-VCS-Directories: src/pkgcore/config/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 8384c20cc1b33a31ff1e49e61a4547c109b0d8e4 X-VCS-Branch: master Date: Tue, 17 Jan 2023 20:50:48 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ed04cddc-28b4-41a5-bb08-60cc66a3ac74 X-Archives-Hash: 2db48078b292e8ceb5d03b99e533743c commit: 8384c20cc1b33a31ff1e49e61a4547c109b0d8e4 Author: Brian Harring gmail com> AuthorDate: Sun Jan 15 05:09:42 2023 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Tue Jan 17 20:49:46 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=8384c20c fix(config): add exception chaining for an internal error. This code was written before exception chaining, but it's esoteric enough we very much want the chain to be thrown. Signed-off-by: Brian Harring gmail.com> Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcore/config/basics.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pkgcore/config/basics.py b/src/pkgcore/config/basics.py index 2bc3e1c9b..91e16dabf 100644 --- a/src/pkgcore/config/basics.py +++ b/src/pkgcore/config/basics.py @@ -86,13 +86,12 @@ class ConfigType: if not getattr(hint_overrides, "authorative", None): try: code = getattr(func_obj, "__code__") - except AttributeError: + except AttributeError as e: if func_obj != object.__init__: raise TypeError( - "func %s has no %r attribute; likely a " + f"func {original_func_obj!r} isn't usable; likely a " "builtin object which can't be introspected without hints" - % (original_func_obj, "__code__") - ) + ) from e else: if code.co_argcount and code.co_varnames[0] == "self": args = code.co_varnames[1 : code.co_argcount]