Skip to content

Commit

Permalink
Merge pull request #40 from tebeka/master
Browse files Browse the repository at this point in the history
Fallback to pymysql
  • Loading branch information
bdarnell committed Sep 5, 2016
2 parents 3a6189f + 3cd925c commit e7bd428
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Limitations
-----------

Torndb does not support Python 3, or any database drivers other than
`MySQLdb`.
`MySQLdb` or `pymysql`.

Installation
------------
Expand Down
17 changes: 10 additions & 7 deletions torndb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
import MySQLdb.converters
import MySQLdb.cursors
except ImportError:
# If MySQLdb isn't available this module won't actually be useable,
# but we want it to at least be importable on readthedocs.org,
# which has limitations on third-party modules.
if 'READTHEDOCS' in os.environ:
MySQLdb = None
else:
raise
try:
import pymysql as MySQLdb
except ImportError:
# If MySQLdb isn't available this module won't actually be useable,
# but we want it to at least be importable on readthedocs.org,
# which has limitations on third-party modules.
if 'READTHEDOCS' in os.environ:
MySQLdb = None
else:
raise

version = "0.3"
version_info = (0, 3, 0, 0)
Expand Down

0 comments on commit e7bd428

Please sign in to comment.