Created
August 31, 2015 22:45
-
-
Save twangboy/b8122cbde4605240121f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import third party libs | |
try: | |
# Try to import MySQLdb | |
import MySQLdb | |
HAS_MYSQLDB = True | |
except ImportError: | |
try: | |
# MySQLdb import failed, try to import PyMySQL | |
import pymysql | |
pymysql.install_as_MySQLdb() | |
import MySQLdb | |
HAS_MYSQLDB = True | |
except ImportError: | |
# No MySQL Connector installed, return False | |
HAS_MYSQLDB = False | |
import MySQLdb.cursors | |
import MySQLdb.converters | |
from MySQLdb.constants import FIELD_TYPE, FLAG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment