[Tutor] Handling MySQLdb exceptions

Paul Schewietzek tetsuo2k6 at web.de
Thu Dec 20 11:08:32 CET 2007


Joshua Simpson schrieb:
> On Dec 19, 2007 10:14 AM, Paul Schewietzek <tetsuo2k6 at web.de 
> <mailto:tetsuo2k6 at web.de>> wrote:
> 
> 
>     Is there any way to handle this exception? As you can see, I already
>     tried it with _mysql_exceptions.OperationalError (the lines that are
>     commented out), but _mysql_exceptions is not defined to Python....
> 
> 
> "OperationalError" is contained in the MySQLdb module and thus 
> namespace, so you'll have to reference it like so:
> 
> except MySQLdb.OperationalError:
> 
> 
> -- 
> -
> http://stderr.ws/
> "Insert pseudo-insightful quote here." - Some Guy

Thanks a lot! It works 8D

-paul


More information about the Tutor mailing list