From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/config/
Date: Tue, 17 Jan 2023 20:50:48 +0000 (UTC) [thread overview]
Message-ID: <1673988586.8384c20cc1b33a31ff1e49e61a4547c109b0d8e4.arthurzam@gentoo> (raw)
commit: 8384c20cc1b33a31ff1e49e61a4547c109b0d8e4
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Sun Jan 15 05:09:42 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> 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 <ferringb <AT> gmail.com>
Signed-off-by: Arthur Zamarin <arthurzam <AT> 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]
next reply other threads:[~2023-01-17 20:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 20:50 Arthur Zamarin [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-02-02 20:10 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/config/ Arthur Zamarin
2023-02-02 20:10 Arthur Zamarin
2023-02-05 18:16 Arthur Zamarin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1673988586.8384c20cc1b33a31ff1e49e61a4547c109b0d8e4.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox