Re: [sage-devel] catch a "sagemath" DeprecationWarning

2016-04-08 Thread Vincent Delecroix
Ha ha. In misc/superseded.py the function warning just reset all filters each time it is called def warning(...): _check_trac_number(trac_number) message += '\n' message += 'See http://trac.sagemath.org/'+ str(trac_number) + ' for details.' resetwarnings() # Stack level 3

[sage-devel] catch a "sagemath" DeprecationWarning

2016-04-08 Thread João Pedro Cruz
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