Skip to content

Commit

Permalink
Add more libmysql search paths.
Browse files Browse the repository at this point in the history
 * Added libmysqlclient.so.18 and libmysqlclient fallback
  • Loading branch information
EnTeQuAk committed Aug 16, 2011
1 parent 32d79b0 commit 8ed2fae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MySQLdb/libmysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ class MYSQL_FIELD(ctypes.Structure):

c = None
# Prefer the higher version, obscure.
for lib in ["libmysqlclient.so.16", "libmysqlclient.so.15", "mysqlclient", "libmysqlclient.18.dylib"]:

_searchpaths = ["libmysqlclient.so.18", "libmysqlclient.so.16",
"libmysqlclient.so.15", "mysqlclient",
"libmysqlclient.18.dylib", "libmysqlclient.so"]

for lib in _searchpaths:
try:
c = ctypes.CDLL(lib)
except OSError:
Expand Down

2 comments on commit 8ed2fae

@jedie
Copy link

@jedie jedie commented on 8ed2fae Aug 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using tuples?

@EnTeQuAk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, because... we can!

Please sign in to comment.