Is it possible for a statement to be executed after raise in python?

import, python, try-catch

Solution

`import psyco` will never be reached because of the exception raised on the previous line. The exception will be caught by the `except` clause, which in this case does nothing. The `else` clause will never be reached because you only reach it if your `try` clause executed without exceptions.

In short, this code will always raise an exception, catch it, and do nothing else. It should be deleted.

Problem

I found following code in TwistedSNMP library: ``` try: raise ImportError import psyco except ImportError, err: pass else: from pysnmp.asn1 import base psyco.bind(base.SimpleAsn1Object) psyco.bind(base.Asn1Object) ``` Source filename: pysnmpproto.py, Line 42 Are there any cases that either `import psyco` or `else` block will ever be executed?

Original source