Skip to content

Commit 8fd0f2b

Browse files
committed
Do not use bare excepts
1 parent 753a551 commit 8fd0f2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

github_backup/github_backup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
from urllib.request import Request
3131
from urllib.request import HTTPRedirectHandler
3232
from urllib.request import build_opener
33+
from subprocess import SubprocessError
3334
except ImportError:
3435
# python 2
3536
PY2 = True
37+
from subprocess import CalledProcessError as SubprocessError
3638
from urlparse import urlparse
3739
from urllib import quote as urlquote
3840
from urllib import urlencode
@@ -363,7 +365,7 @@ def get_auth(args, encode=True, for_git_cli=False):
363365
if not PY2:
364366
token = token.decode('utf-8')
365367
auth = token + ':' + 'x-oauth-basic'
366-
except:
368+
except SubprocessError:
367369
log_error('No password item matching the provided name and account could be found in the osx keychain.')
368370
elif args.osx_keychain_item_account:
369371
log_error('You must specify both name and account fields for osx keychain password items')

0 commit comments

Comments
 (0)