From 79d7493582fef9bb17628cbe553fc1d93fe7ce1c Mon Sep 17 00:00:00 2001 From: thefeiter <46082330+thefeiter@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:55:45 +0200 Subject: [PATCH] Update ceval_macros.h to comply with Pythons naming scheme UnboundLocalError uses the term "variable" for something that is called a "name" in python. This can lead to confusion when getting this error. --- Python/ceval_macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index bd28126b0b7dfb..4d8cfec0771727 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -305,9 +305,9 @@ GETITEM(PyObject *v, Py_ssize_t i) { } while (0); #define UNBOUNDLOCAL_ERROR_MSG \ - "cannot access local variable '%s' where it is not associated with a value" + "cannot access local name '%s' where it is not associated with a value" #define UNBOUNDFREE_ERROR_MSG \ - "cannot access free variable '%s' where it is not associated with a value" \ + "cannot access free name '%s' where it is not associated with a value" \ " in enclosing scope" #define NAME_ERROR_MSG "name '%.200s' is not defined"