Be more compliant in Python MySQLdb usage