diff options
author | Dick Marinus <dick@mrns.nl> | 2018-06-10 13:07:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-10 13:07:38 +0200 |
commit | 3fbe8e7cb3ca57fd8656890ea7855da62d2ea03e (patch) | |
tree | 16b776e585f5a10e5f51a0d0a75822eeabc1c6f0 | |
parent | 9d2f11164c6c3a30c882cc418c69b114cdef6f8a (diff) | |
parent | beca2821963f74b5b172686fcb5f3b9d57026a5c (diff) |
Merge pull request #897 from gma2th/hotfix/output-unbound-local-error
Hotfix/output unbound local error
-rw-r--r-- | changelog.rst | 1 | ||||
-rw-r--r-- | pgcli/main.py | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/changelog.rst b/changelog.rst index 4fe768cf..bd0438f6 100644 --- a/changelog.rst +++ b/changelog.rst @@ -22,6 +22,7 @@ Bug Fixes: * Make keyring optional. (Thanks: `Dick Marinus`_) * Fix ipython magic connection (#891). (Thanks: `Irina Truong`_) * Fix not enough values to unpack. (Thanks: `Matthieu Guilbert`_) +* Fix unbound local error when destructive_warning is false. (Thanks: `Matthieu Guilbert`_) 1.9.1: ====== diff --git a/pgcli/main.py b/pgcli/main.py index 1e4de645..10e841cb 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -505,14 +505,12 @@ class PGCli(object): try: if (self.destructive_warning): destroy = confirm = confirm_destructive_query(text) - if destroy is None: - output, query = self._evaluate_command(text) - elif destroy is True: - click.secho('Your call!') - output, query = self._evaluate_command(text) - else: + if destroy is False: click.secho('Wise choice!') raise KeyboardInterrupt + elif destroy: + click.secho('Your call!') + output, query = self._evaluate_command(text) except KeyboardInterrupt: # Restart connection to the database self.pgexecute.connect() |