1
0
Fork 0

Remove "'OperationalError' object has no attribute 'message'" error message if you need to provide a password on Python3

This commit is contained in:
Ludovic Gasc (GMLudo) 2015-01-10 15:21:43 +01:00
parent 7e35be0d4f
commit be4ecded30
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ class PGCli(object):
try:
pgexecute = PGExecute(database, user, passwd, host, port)
except OperationalError as e:
if 'no password supplied' in e.message and auto_passwd_prompt:
if 'no password supplied' in e.args[0] and auto_passwd_prompt:
passwd = click.prompt('Password', hide_input=True,
show_default=False, type=str)
pgexecute = PGExecute(database, user, passwd, host, port)