diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-23 21:14:59 -0800 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-23 21:14:59 -0800 |
commit | e90f5410336aa54c93b4fe5777e4370061c9d509 (patch) | |
tree | 6652da6643430dd9431752c3abab08a7c213f6ba | |
parent | 35909de7517077444bc9db39aee009b59fc10e1f (diff) |
Check if cursor is none before checking rowcount.
-rwxr-xr-x | pgcli/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index cf43e706..7ed04c39 100755 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -203,11 +203,11 @@ class PGCli(object): logger.debug("status: %r", status) start = time() threshold = 1000 - if is_select(status) and cur.rowcount > threshold: + if (is_select(status) and + cur and cur.rowcount > threshold): click.secho('The result set has more than %s rows.' % threshold, fg='red') - if not click.confirm('Do you want to continue?', - default=True): + if not click.confirm('Do you want to continue?'): click.secho("Aborted!", err=True, fg='red') break output.extend(format_output(cur, headers, status)) |