Skip to content

Commit 6d517e2

Browse files
committed
Improve determination of DBAPI module
1 parent f2186a8 commit 6d517e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dbutils/steady_db.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ def __init__(
148148
# proper initialization of the connection
149149
try:
150150
self._creator = creator.connect
151-
self._dbapi = creator
151+
try:
152+
if creator.dbapi.connect:
153+
self._dbapi = creator.dbapi
154+
except AttributeError:
155+
self._dbapi = creator
152156
except AttributeError:
153157
# try finding the DB-API 2 module via the connection creator
154158
self._creator = creator

0 commit comments

Comments
 (0)