Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7762

Re: Trapping MySQLdb warnings

Date 2011-06-16 11:13 -0800
From Tim Johnson <tim@johnsons-web.com>
Subject Re: Trapping MySQLdb warnings
References <20110616015837.GA1885@johnsons-web.com> <BANLkTint8YP9W7hUnvYh4nmMo_6h0WPXTA@mail.gmail.com> <20110616023829.GB1885@johnsons-web.com> <20110616155533.GD1885@johnsons-web.com> <itdj4h$mrn$1@dough.gmane.org>
Organization AkWebsoft
Newsgroups comp.lang.python
Message-ID <mailman.36.1308251593.1164.python-list@python.org> (permalink)

Show all headers | View raw


* Terry Reedy <tjreedy@udel.edu> [110616 10:50]:
<...> 
> Substitute specific MySQLdb warning class, whatever it is, for Warning.
  Hmm! Consider the following code:
try :
  self.__rdb.execute(S)
  raise MySQLdb.Warning('danger, danger Monte Python') ## just for grins
except MySQLdb.Warning,e:
  std.debug("e",e,0,0,'mysql.py:195',0)  ## DEBUG GLOBAL
## result:
INSPECTING `e'  (F:mysql.py:195):
danger, danger Monte Python
## Question:

Am I initializing the cursor to raise warnings? I *so* rusty at this, but I
suspect that something needs to be done with either the instantiation of the
'parent' connection object or the cursor object itself.

-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Trapping MySQLdb warnings Tim Johnson <tim@johnsons-web.com> - 2011-06-16 11:13 -0800

csiph-web