Skip to content

Commit 0098f08

Browse files
authored
[PEP-654] add None check in subgroup example (GH-2132)
Joe Gottman alerted us to an error in this example, which is missing a None check.
1 parent 00cb14d commit 0098f08

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pep-0654.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,9 @@ OS errors, while letting all other exceptions propagate.
10231023
try:
10241024
low_level_os_operation()
10251025
except* OSError as errors:
1026-
raise errors.subgroup(lambda e: e.errno != errno.EPIPE) from None
1026+
exc = errors.subgroup(lambda e: e.errno != errno.EPIPE)
1027+
if exc is not None:
1028+
raise exc from None
10271029
10281030
10291031
Caught Exception Objects
@@ -1478,7 +1480,7 @@ ways, both the design and the exposition. For this we appreciate all those who
14781480
contributed ideas and asked good questions: Ammar Askar, Matthew Barnett,
14791481
Ran Benita, Emily Bowman, Brandt Bucher, Joao Bueno, Baptiste Carvello,
14801482
Rob Cliffe, Nick Coghlan, Steven D'Aprano, Caleb Donovick, Steve Dower,
1481-
Greg Ewing, Ethan Furman, Pablo Salgado, Jonathan Goble, Thomas Grainger,
1483+
Greg Ewing, Ethan Furman, Pablo Salgado, Jonathan Goble, Joe Gottman, Thomas Grainger,
14821484
Larry Hastings, Zac Hatfield-Dodds, Chris Jerdonek, Jim Jewett, Sven Kunze,
14831485
Łukasz Langa, Glenn Linderman, Paul Moore, Antoine Pitrou, Ivan Pozdeev,
14841486
Patrick Reader, Terry Reedy, Sascha Schlemmer, Barry Scott, Mark Shannon,

0 commit comments

Comments
 (0)