From: Daniele Varrazzo Date: Fri, 7 Jan 2022 17:32:47 +0000 (+0100) Subject: Don't overwrite the module of the psycopg.pq.pq_ctypes objects X-Git-Tag: pool-3.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5193d49ae638bc277e524e3445e994848bd18945;p=thirdparty%2Fpsycopg.git Don't overwrite the module of the psycopg.pq.pq_ctypes objects It might be useful to tell apart the C version from the python versions for debugging. The C versions don't do it, so they repr as: See #201. --- diff --git a/psycopg/psycopg/pq/pq_ctypes.py b/psycopg/psycopg/pq/pq_ctypes.py index 83b288212..2639f758c 100644 --- a/psycopg/psycopg/pq/pq_ctypes.py +++ b/psycopg/psycopg/pq/pq_ctypes.py @@ -67,7 +67,6 @@ class PGconn: Python representation of a libpq connection. """ - __module__ = "psycopg.pq" __slots__ = ( "_pgconn_ptr", "notice_handler", @@ -729,7 +728,6 @@ class PGresult: Python representation of a libpq result. """ - __module__ = "psycopg.pq" __slots__ = ("_pgresult_ptr",) def __init__(self, pgresult_ptr: impl.PGresult_struct): @@ -860,7 +858,6 @@ class PGcancel: Created by `PGconn.get_cancel()`. """ - __module__ = "psycopg.pq" __slots__ = ("pgcancel_ptr",) def __init__(self, pgcancel_ptr: impl.PGcancel_struct): @@ -901,8 +898,6 @@ class Conninfo: Utility object to manipulate connection strings. """ - __module__ = "psycopg.pq" - @classmethod def get_defaults(cls) -> List[ConninfoOption]: opts = impl.PQconndefaults() @@ -956,8 +951,6 @@ class Escaping: Utility object to escape strings for SQL interpolation. """ - __module__ = "psycopg.pq" - def __init__(self, conn: Optional[PGconn] = None): self.conn = conn