From: Daniele Varrazzo Date: Thu, 16 Apr 2020 14:18:15 +0000 (+1200) Subject: Small fixes to the ctypes module X-Git-Tag: 3.0.dev0~553 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39ef6319baa0d44fd58fd679623c193fe261fcc4;p=thirdparty%2Fpsycopg.git Small fixes to the ctypes module --- diff --git a/psycopg3/pq/pq_ctypes.py b/psycopg3/pq/pq_ctypes.py index a267af136..e7683626b 100644 --- a/psycopg3/pq/pq_ctypes.py +++ b/psycopg3/pq/pq_ctypes.py @@ -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)