diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-09-18 14:00:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-09-18 14:00:16 +0000 |
commit | 955e6bd558e15fa1b0cde9a944d6f53d202d91c2 (patch) | |
tree | 61a64b7361ab0890521771a5d185db787482eaaf /lib/sqlalchemy/dialects/postgresql/pg8000.py | |
parent | c50183274728544e40e7da4fd35cf240da5df656 (diff) | |
parent | 26140c08111da9833dd2eff0b5091494f253db46 (diff) | |
download | sqlalchemy-955e6bd558e15fa1b0cde9a944d6f53d202d91c2.tar.gz |
Merge "Surface driver connection object when using a proxied dialect"
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/pg8000.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/pg8000.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index 3d1051b7d..d42dd9560 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -433,8 +433,8 @@ class PGDialect_pg8000(PGDialect): level = level.replace("_", " ") # adjust for ConnectionFairy possibly being present - if hasattr(connection, "connection"): - connection = connection.connection + if hasattr(connection, "dbapi_connection"): + connection = connection.dbapi_connection if level == "AUTOCOMMIT": connection.autocommit = True @@ -498,8 +498,8 @@ class PGDialect_pg8000(PGDialect): def set_client_encoding(self, connection, client_encoding): # adjust for ConnectionFairy possibly being present - if hasattr(connection, "connection"): - connection = connection.connection + if hasattr(connection, "dbapi_connection"): + connection = connection.dbapi_connection cursor = connection.cursor() cursor.execute("SET CLIENT_ENCODING TO '" + client_encoding + "'") |