bpo-17792: more accurate error message for unbound variable access exceptions (GH-24976)
This commit is contained in:
parent
1a8c778471
commit
7b1f527d5b
@ -0,0 +1 @@
|
|||||||
|
More accurate error messages for access of unbound locals or free vars.
|
@ -101,10 +101,10 @@ static int get_exception_handler(PyCodeObject *, int, int*, int*, int*);
|
|||||||
#define NAME_ERROR_MSG \
|
#define NAME_ERROR_MSG \
|
||||||
"name '%.200s' is not defined"
|
"name '%.200s' is not defined"
|
||||||
#define UNBOUNDLOCAL_ERROR_MSG \
|
#define UNBOUNDLOCAL_ERROR_MSG \
|
||||||
"local variable '%.200s' referenced before assignment"
|
"cannot access local variable '%s' where it is not associated with a value"
|
||||||
#define UNBOUNDFREE_ERROR_MSG \
|
#define UNBOUNDFREE_ERROR_MSG \
|
||||||
"free variable '%.200s' referenced before assignment" \
|
"cannot access free variable '%s' where it is not associated with a" \
|
||||||
" in enclosing scope"
|
" value in enclosing scope"
|
||||||
|
|
||||||
/* Dynamic execution profile */
|
/* Dynamic execution profile */
|
||||||
#ifdef DYNAMIC_EXECUTION_PROFILE
|
#ifdef DYNAMIC_EXECUTION_PROFILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user