This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jyasskin
Recipients collinwinter, jyasskin
Date 2009-05-08.17:43:58
SpamBayes Score 1.69987e-09
Marked as misclassified No
Message-id <>
There's an obscure bug in sys.exc_info after a yield statement.

  def test():
      def raising_generator():
              raise IndexError("inner exception")
          except IndexError:
              yield 3
              # Here, sys.exc_info() ought to refer to the inner
              # exception, but instead it refers to the outer one.
          raise ValueError("outer exception")
      except ValueError:
          for i in raising_generator(): pass

sys.exc_info gets reset even if there's no outer exception.

The attached (failing) patch highlights this problem, and tests other
sys.exc_info behavior around function calls.
Date User Action Args
2009-05-08 17:44:02jyasskinsetrecipients: + jyasskin, collinwinter
2009-05-08 17:44:01jyasskinsetmessageid: <>
2009-05-08 17:44:00jyasskinlinkissue5970 messages
2009-05-08 17:43:59jyasskincreate