]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix returning connection params in get_parameters() with empty default
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 Aug 2021 09:34:01 +0000 (11:34 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 3 Aug 2021 10:57:53 +0000 (11:57 +0100)
"options" and "tty" were returned even if they were set to their
default.

psycopg/psycopg/conninfo.py

index 3d665c94b7c2e724c07e0a26239d364454849b35..9dfff13397a480b54fcfbb838a49d01dff1a8fc5 100644 (file)
@@ -170,7 +170,7 @@ class ConnectionInfo:
         defaults = {
             i.keyword: i.compiled
             for i in pq.Conninfo.get_defaults()
-            if i.compiled
+            if i.compiled is not None
         }
         # Not returned by the libq. Bug? Bet we're using SSH.
         defaults.setdefault(b"channel_binding", b"prefer")