Python Forum
raise exception within generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
raise exception within generator
#3
Thanks for the reply.

According to the link below one has to handle any StopIteration exceptions one generates within the
generator itself. If one does not and lets the exception bubble out from the generator then Python turns it into a RuntimeError.

https://www.python.org/dev/peps/pep-0479/
Reply


Messages In This Thread
raise exception within generator - by bermudj - May-24-2020, 04:23 PM
RE: raise exception within generator - by buran - May-24-2020, 04:58 PM
RE: raise exception within generator - by bermudj - Jun-06-2020, 09:51 AM
RE: raise exception within generator - by buran - Jun-06-2020, 11:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  can i raise an exception in a try clause? Skaperen 14 5,833 Dec-19-2019, 12:29 AM
Last Post: Skaperen
  Changing a traceback message without a 2nd raise Clunk_Head 1 2,015 Jul-14-2019, 12:45 AM
Last Post: Gribouillis
  During handling of the above exception, another exception occurred Skaperen 7 26,989 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  raise exception instead of return None Skaperen 4 4,175 Jul-19-2018, 01:27 AM
Last Post: ichabod801
  "Raise SMTPException("SMTP AUTH extension not supported by server.") NajeebUllah 3 8,031 Mar-16-2018, 09:45 PM
Last Post: nilamo
  receive from a generator, send to a generator Skaperen 9 5,572 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020