From 77a361966a6cbe73ba153710f10f32cc27d167f5 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Wed, 15 Jan 2020 10:26:07 +0530 Subject: Fix warning raised for using `is not` to compare string literal (#1139) Using `is not` for comparing string literals raises warning that != should be used. Fixes #1138 --- AUTHORS | 1 + changelog.rst | 7 ++++++- pgcli/main.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index faf9b189..b0401383 100644 --- a/AUTHORS +++ b/AUTHORS @@ -103,6 +103,7 @@ Contributors: * Martin Matejek (mmtj) * Jonas Jelten * BrownShibaDog + * George Thomas(thegeorgeous) Creator: -------- diff --git a/changelog.rst b/changelog.rst index 1b12b15f..991139be 100644 --- a/changelog.rst +++ b/changelog.rst @@ -7,11 +7,15 @@ Features: * Add `__main__.py` file to execute pgcli as a package directly (#1123). * Add support for ANSI escape sequences for coloring the prompt (#1122). +Bug fixes: + +* Fix warning raised for using `is not` to compare string literal + Internal: --------- * Fix dead link in development guide. (Thanks: `BrownShibaDog`_) - + 2.2.0: ====== @@ -1023,3 +1027,4 @@ Improvements: .. _`Sebastian Janko`: https://github.com/sebojanko .. _`Pedro Ferrari`: https://github.com/petobens .. _`BrownShibaDog`: https://github.com/BrownShibaDog +.. _`thegeorgeous`: https://github.com/thegeorgeous diff --git a/pgcli/main.py b/pgcli/main.py index 2301d16f..54d4941f 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -1258,7 +1258,7 @@ def cli( if list_databases: database = "postgres" - if dsn is not "": + if dsn != "": try: cfg = load_config(pgclirc, config_full_path) dsn_config = cfg["alias_dsn"][dsn] -- cgit v1.2.3