1
0
Fork 0

make keyring optional

This commit is contained in:
Dick Marinus 2018-05-26 11:26:06 +02:00
parent a274c731fc
commit 2ce2a87f37
2 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,7 @@ Bug Fixes:
----------
* Disable pager when using \watch (#837). (Thanks: `Jason Ribeiro`_)
* Don't offer to reconnect when we can't change a param in realtime (#807). (Thanks: `Amjith Ramanujam`_)
* Make keyring optional. (Thanks: `Dick Marinus`_)
1.9.1:
======

View File

@ -433,7 +433,10 @@ class PGCli(object):
pgexecute = PGExecute(database, user, passwd, host, port, dsn,
application_name='pgcli', **kwargs)
if passwd:
keyring.set_password('pgcli', key, passwd)
try:
keyring.set_password('pgcli', key, passwd)
except keyring.errors.InitError:
pass
except (OperationalError, InterfaceError) as e:
if ('no password supplied' in utf8tounicode(e.args[0]) and
auto_passwd_prompt):