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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0BF69138239 for ; Sat, 29 May 2021 08:33:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 62CD9E0880; Sat, 29 May 2021 08:33:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 16D05E0880 for ; Sat, 29 May 2021 08:33:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C28FB335DBD for ; Sat, 29 May 2021 08:33:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1332378B for ; Sat, 29 May 2021 08:33:27 +0000 (UTC) From: "Rolf Eike Beer" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Rolf Eike Beer" Message-ID: <1622277202.f21b0d05feb942e814a94190b63e0b918f622bab.dakon@gentoo> Subject: [gentoo-commits] proj/tatt:master commit in: scripts/ X-VCS-Repository: proj/tatt X-VCS-Files: scripts/tatt X-VCS-Directories: scripts/ X-VCS-Committer: dakon X-VCS-Committer-Name: Rolf Eike Beer X-VCS-Revision: f21b0d05feb942e814a94190b63e0b918f622bab X-VCS-Branch: master Date: Sat, 29 May 2021 08:33:27 +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: c96b42c5-ccfc-421b-94dc-95b36462acf9 X-Archives-Hash: 94e782b7fd09153578c1da557b2b0749 commit: f21b0d05feb942e814a94190b63e0b918f622bab Author: Rolf Eike Beer sf-mail de> AuthorDate: Sat May 29 08:29:56 2021 +0000 Commit: Rolf Eike Beer sf-mail de> CommitDate: Sat May 29 08:33:22 2021 +0000 URL: https://gitweb.gentoo.org/proj/tatt.git/commit/?id=f21b0d05 output a proper error message if the bug does not exist Otherwise one would see the following misleading message: File "/usr/lib/python-exec/python3.8/tatt", line 155, in response = response["bugs"][0] IndexError: list index out of range Signed-off-by: Rolf Eike Beer sf-mail.de> scripts/tatt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/tatt b/scripts/tatt index 7524c8b..7d0f378 100755 --- a/scripts/tatt +++ b/scripts/tatt @@ -152,6 +152,10 @@ if options.bugnum: if "message" in response: print(response["message"]) sys.exit(1) + if len(response["bugs"]) == 0: + print("bug " + options.bugnum + " not found in bugzilla") + sys.exit(1) + response = response["bugs"][0] if "KEYWORDREQ" in response["keywords"] or response["component"] == "Keywording": # This is a keywording bug: