From 7d278cde21aa23aea0e111c290be0b9264291c16 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Tue, 9 Aug 2022 12:12:31 -0400 Subject: [PATCH] ubuntu-build: use correct exception from LP login failure --- ubuntu-build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubuntu-build b/ubuntu-build index a557d1e..3e02141 100755 --- a/ubuntu-build +++ b/ubuntu-build @@ -30,6 +30,7 @@ from ubuntutools.lp.udtexceptions import (SeriesNotFoundException, PackageNotFoundException, PocketDoesNotExistError,) from ubuntutools.lp.lpapicache import Distribution, PersonTeam +from launchpadlib.credentials import TokenAuthorizationException from ubuntutools.misc import split_release_pocket from ubuntutools import getLogger @@ -138,7 +139,7 @@ def main(): try: # Will fail here if we have no credentials, bail out Launchpad.login() - except IOError: + except TokenAuthorizationException: sys.exit(1) # Get the ubuntu archive