importsystry:sys.exc_infoexcept:print("SKIP")raiseSystemExitdeff():print(sys.exc_info()[0:2])try:raiseValueError('value',123)except:print(sys.exc_info()[0:2])f()# Outside except block, sys.exc_info() should be back to None'sf()# Recursive except blocks are not handled - just don't# use exc_info() at all, use explicit variables in "except".