Skip to content

Commit 3b82cae

Browse files
authored
bpo-38530: Properly extend UnboundLocalError from NameError (GH-25444)
1 parent b136b1a commit 3b82cae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/exceptions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ ComplexExtendsException(PyExc_Exception, NameError,
13931393
/*
13941394
* UnboundLocalError extends NameError
13951395
*/
1396-
SimpleExtendsException(PyExc_NameError, UnboundLocalError,
1396+
1397+
MiddlingExtendsException(PyExc_NameError, UnboundLocalError, NameError,
13971398
"Local name referenced but not bound to a value.");
13981399

13991400
/*

0 commit comments

Comments
 (0)