Skip to content

Commit 5a5bd75

Browse files
Flowdalicarthurzam
authored andcommitted
pkgdev_bugs: do not swallow exceptions when reading ~/.bugz_token
In case the file is not readable, or other issues, do not swallow the exception. Signed-off-by: Florian Schmaus <[email protected]> Closes: #158 Signed-off-by: Arthur Zamarin <[email protected]>
1 parent 60deeaf commit 5a5bd75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pkgdev/scripts/pkgdev_bugs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,9 @@ def main(options, out: Formatter, err: Formatter):
546546
node.cleanup_keywords(search_repo)
547547

548548
if options.api_key is None:
549-
with contextlib.suppress(Exception):
550-
options.api_key = (Path.home() / ".bugz_token").read_text().strip() or None
549+
bugz_token_file = Path.home() / ".bugz_token"
550+
if bugz_token_file.is_file:
551+
options.api_key = bugz_token_file.read_text().strip()
551552

552553
if not d.nodes:
553554
out.write(out.fg("red"), "Nothing to do, exiting", out.reset)

0 commit comments

Comments
 (0)