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 940AB158020 for ; Sat, 12 Nov 2022 10:51:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCFA1E09B0; Sat, 12 Nov 2022 10:51:31 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B0C88E09B0 for ; Sat, 12 Nov 2022 10:51:31 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C06B333C84E for ; Sat, 12 Nov 2022 10:51:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 112E5617 for ; Sat, 12 Nov 2022 10:51:29 +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: <1668250165.fa5153ff81b8159fa59dc2495f5bf9cdf36a99a4.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/scripts/ X-VCS-Repository: proj/pkgcore/pkgcore X-VCS-Files: src/pkgcore/scripts/pquery.py X-VCS-Directories: src/pkgcore/scripts/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: fa5153ff81b8159fa59dc2495f5bf9cdf36a99a4 X-VCS-Branch: master Date: Sat, 12 Nov 2022 10:51:29 +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: cf6bd15a-fdf5-4e14-ba69-6645148a7dfc X-Archives-Hash: 95232abe4d678a75c2c5f229d75b83e2 commit: fa5153ff81b8159fa59dc2495f5bf9cdf36a99a4 Author: Arthur Zamarin gentoo org> AuthorDate: Sat Nov 12 10:49:25 2022 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Sat Nov 12 10:49:25 2022 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=fa5153ff pquery: fix crash with verbose single uris attr When the `uris` attribute has only one value, and the `verbose` option was used, pquery was crashing because `node.uri` isn't subscriptable. Use more agnostic `next(iter(node.uris))` instead. Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcore/scripts/pquery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkgcore/scripts/pquery.py b/src/pkgcore/scripts/pquery.py index 6bc04994d..eaba242f3 100644 --- a/src/pkgcore/scripts/pquery.py +++ b/src/pkgcore/scripts/pquery.py @@ -269,7 +269,7 @@ def format_attr(config, out, pkg, attr): if not node.uri: return False if len(node.uri) == 1: - out.write(node.uri[0], autoline=False) + out.write(next(iter(node.uri)), autoline=False) return False out.write('|| (') out.first_prefix.append(' ')