What is the correct way to identify an Exception?
<p>If exceptions are always fatal, making use of them in Python is easy</p>

<pre><code># moduleB.py
import moduleC
</code></pre>

<p>But evaluating an exception requires more than just it's type, we often need to determine where an exception came from</p>

<pre><code># moduleA.py
try:
   import moduleB
except ImportError as e:
    print e
    if str(e) == "No module named moduleB":
        pass
    else:
        raise
</code></pre>

<p>In some projects this pattern results in a lot of code that is not easy to read. Is this the best way to ensure that I'm catching a local exception? I would like to be able write</p>

<pre><code>import moduleB else pass
</code></pre>
