[pygtk] try/except won't trap DeprecationWarning from OptionMenu

Alessandro Dentella sandro at e-den.it
Thu Jan 22 02:05:42 WST 2009


Hi,

  I'd like to use deprecated OptionMenu, but I can't stop the
  DeprecationWarning. Why is it different from a self produced one?

import gtk

try:
    raise DeprecationWarning
except DeprecationWarning, e:
    pass


try:
    a = gtk.OptionMenu()
except DeprecationWarning, e:
    pass

  
  only the first one will be trapped. Why?
  Is there a way to stop it?



  sandro
  *:-)


PS: the reason why I want to use OptionMenu is as per my other thread the
    possibilityto add tooltips
  
-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy


More information about the pygtk mailing list