Hello, I was expecting the following to catch the DeprecationWarning
import warnings warnings.filterwarnings('error',category=DeprecationWarning) try: print (exp(x)*exp(3*x)).simplify_exp() #example with exp function except DeprecationWarning: print 'MegBook.py say: exercise needs review!' but it does not. I still got DeprecationWarning: simplify_exp is deprecated. Please use canonicalize_radical instead. See http://trac.sagemath.org/11912 for details. print (exp(x)*exp(_sage_const_3 *x)).simplify_exp() #example with exp function *How can we catch this "type" of* DeprecationWarning ? I've checked https://github.com/sagemath/sage/blob/master/src/sage/misc/superseded.py but reached no conclusion. I appreciate help, Thank you. Pedro The following works easy: try: raise DeprecationWarning except DeprecationWarning : print 'Got it' -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.