Avoiding "Too broad exception clause" warning in PyCharm
<p>I'm writing an exception clause at the top level of a script, and I just want it to log whatever errors occur. Annoyingly, PyCharm complains if I just catch <code>Exception</code>.</p>

<pre><code>import logging

logging.basicConfig()

try:
    raise RuntimeError('Bad stuff happened.')
except Exception:  # &lt;= causes warning: Too broad exception clause
    logging.error('Failed.', exc_info=True)
</code></pre>

<p>Is there something wrong with this handler? If not, how can I tell PyCharm to shut up about it?</p>