The error handling in the SQL code failed if pymysql was used as a replacement for MySQLdb.
I have simply replaced the handler with a catch-all since getting this right in the context of dynamic imports are quite nasty. I cannot really imagine when we do not want to catch an error in this situation, so catch-all so be acceptable.
Also fixed approximately 50% of the flake8 errors in this file :)
The error handling in the SQL code failed if pymysql was used as a replacement for MySQLdb.
I have simply replaced the handler with a catch-all since getting this right in the context of dynamic imports are quite nasty. I cannot really imagine when we do not want to catch an error in this situation, so catch-all so be acceptable.
Also fixed approximately 50% of the flake8 errors in this file :)