1
0
Fork 0

Fix a crash when invalid sql is entered.

This commit is contained in:
Amjith Ramanujam 2015-01-18 20:49:16 -08:00
parent a795c4f200
commit b1cc36db2f
1 changed files with 4 additions and 4 deletions

View File

@ -182,10 +182,10 @@ class PGCli(object):
logger.debug('sql: %r', document.text)
successful = False
start = time()
# Initialized to None because res might never get
# initialized if an exception occurs in pgexecute.run().
# Which causes finally clause to fail.
res = None
# Initialized to [] because res might never get initialized
# if an exception occurs in pgexecute.run(). Which causes
# finally clause to fail.
res = []
res = pgexecute.run(document.text)
duration = time() - start
successful = True