title: try-except and RuntimeWarning
body: <p>This should be an easy one, but it's cracking my head.</p>
  
  <p>A statement in one of my Python scripts is giving a RuntimeWarning message:</p>
  
  <pre><code>RuntimeWarning: invalid value encountered in double_scalars
    z = 1.0/(D*ppr + E*y**2 - F*y**G)
  </code></pre>
  
  <p>Still the script runs, plots a beautiful chart, shows acceptable results, etc. But this warning is bugging me. It indicates that something in my script is fishy.</p>
  
  <p>I wanted to check values whenever this happens. Shouldn't this work?</p>
  
  <pre><code>  try:
      z = 1.0/(D*ppr + E*y**2 - F*y**G)
    except RuntimeWarning:
      print (D, E, F, G, ppr, y)
  </code></pre>
  
  <p>But it doesn't (the script runs as before, though). 'except Warning:' doesn't work either.</p>
  
  <p>Yet those two exceptions are listed here: <a href="https://docs.python.org/3/library/exceptions.html" rel="nofollow noreferrer">https://docs.python.org/3/library/exceptions.html</a></p>
  
  <p>What's the problem here? Thanks for any help.</p>
  
  <p>PS: I'm using Spyder 4.1.1 IDE. Does that make any difference?</p>