]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Small fixes to the ctypes module
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 16 Apr 2020 14:18:15 +0000 (02:18 +1200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 16 Apr 2020 14:26:00 +0000 (02:26 +1200)
psycopg3/pq/pq_ctypes.py

index a267af136ee89add2c4fe071ca991f8f6586f7cb..e7683626b152b7ac94e9175836efc1863d7d0f8a 100644 (file)
@@ -248,7 +248,7 @@ class PGconn:
         param_types: Optional[Sequence[int]] = None,
     ) -> None:
         atypes: Optional[Array[impl.Oid]]
-        if param_types is None:
+        if not param_types:
             nparams = 0
             atypes = None
         else:
@@ -321,7 +321,7 @@ class PGconn:
         else:
             if len(param_formats) != nparams:
                 raise ValueError(
-                    "got %d param_values but %d param_types"
+                    "got %d param_values but %d param_formats"
                     % (nparams, len(param_formats))
                 )
             aformats = (c_int * nparams)(*param_formats)