]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix pre-ping regression in old PyMySQL versions.
authorFederico Caselli <cfederico87@gmail.com>
Wed, 22 Nov 2023 21:04:03 +0000 (22:04 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 22 Nov 2023 22:24:40 +0000 (23:24 +0100)
Fixed regression introduced by the fix in ticket :ticket:`10492` when using
pool pre-ping with PyMySQL version older than 1.0.

Fixes: #10650
Change-Id: Ic0744c8b6f91cc39868e31c3bfddb8df20c7dfbb

doc/build/changelog/unreleased_14/10650.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/pymysql.py

diff --git a/doc/build/changelog/unreleased_14/10650.rst b/doc/build/changelog/unreleased_14/10650.rst
new file mode 100644 (file)
index 0000000..dce6b4c
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: bug, mysql
+    :tickets: 10650
+    :versions: 2.0.24
+
+    Fixed regression introduced by the fix in ticket :ticket:`10492` when using
+    pool pre-ping with PyMySQL version older than 1.0.
index 26a03fa4c9561bef9489dfca6c25961877b0441b..a08418096bef9f1876d86c4d7e0bc9b921d351a6 100644 (file)
@@ -91,7 +91,9 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb):
         """  # noqa: E501
 
         try:
-            Connection = __import__("pymysql.connections").Connection
+            Connection = __import__(
+                "pymysql.connections"
+            ).connections.Connection
         except (ImportError, AttributeError):
             return True
         else: