Skip to content

Commit

Permalink
[PEP-654] add None check in subgroup example (GH-2132)
Browse files Browse the repository at this point in the history
Joe Gottman alerted us to an error in this example, which is missing a None check.
  • Loading branch information
iritkatriel authored Nov 5, 2021
1 parent 00cb14d commit 0098f08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pep-0654.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,9 @@ OS errors, while letting all other exceptions propagate.
try:
low_level_os_operation()
except* OSError as errors:
raise errors.subgroup(lambda e: e.errno != errno.EPIPE) from None
exc = errors.subgroup(lambda e: e.errno != errno.EPIPE)
if exc is not None:
raise exc from None
Caught Exception Objects
Expand Down Expand Up @@ -1478,7 +1480,7 @@ ways, both the design and the exposition. For this we appreciate all those who
contributed ideas and asked good questions: Ammar Askar, Matthew Barnett,
Ran Benita, Emily Bowman, Brandt Bucher, Joao Bueno, Baptiste Carvello,
Rob Cliffe, Nick Coghlan, Steven D'Aprano, Caleb Donovick, Steve Dower,
Greg Ewing, Ethan Furman, Pablo Salgado, Jonathan Goble, Thomas Grainger,
Greg Ewing, Ethan Furman, Pablo Salgado, Jonathan Goble, Joe Gottman, Thomas Grainger,
Larry Hastings, Zac Hatfield-Dodds, Chris Jerdonek, Jim Jewett, Sven Kunze,
Łukasz Langa, Glenn Linderman, Paul Moore, Antoine Pitrou, Ivan Pozdeev,
Patrick Reader, Terry Reedy, Sascha Schlemmer, Barry Scott, Mark Shannon,
Expand Down

0 comments on commit 0098f08

Please sign in to comment.