summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-06-02 13:09:04 (GMT)
committerGitHub <noreply@github.com>2021-06-02 13:09:04 (GMT)
commit7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f (patch)
treeb2f4f79323c9794f555331ff9151b3662bc901cc /Python/ceval.c
parent1a8c77847118d16025337f17cf28fd35c962694b (diff)
downloadcpython-7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f.zip
cpython-7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f.tar.gz
cpython-7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f.tar.bz2
bpo-17792: more accurate error message for unbound variable access exceptions (GH-24976)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3bbcfe9..4dff7bd 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -101,10 +101,10 @@ static int get_exception_handler(PyCodeObject *, int, int*, int*, int*);
#define NAME_ERROR_MSG \
"name '%.200s' is not defined"
#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 \
- "free variable '%.200s' referenced before assignment" \
- " in enclosing scope"
+ "cannot access free variable '%s' where it is not associated with a" \
+ " value in enclosing scope"
/* Dynamic execution profile */
#ifdef DYNAMIC_EXECUTION_PROFILE