Skip to content

Commit 02c19f0

Browse files
[3.12] gh-122270: Fix typos in the Py_DEBUG macro name (GH-122271) (GH-122276)
(cherry picked from commit 6c09b8d) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 9d65ea1 commit 02c19f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Parser/pegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres)
394394

395395
for (Memo *m = t->memo; m != NULL; m = m->next) {
396396
if (m->type == type) {
397-
#if defined(PY_DEBUG)
397+
#if defined(Py_DEBUG)
398398
if (0 <= type && type < NSTATISTICS) {
399399
long count = m->mark - p->mark;
400400
// A memoized negative result counts for one.

Tools/peg_generator/peg_extension/peg_extension.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ parse_string(PyObject *self, PyObject *args, PyObject *kwds)
108108
static PyObject *
109109
clear_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
110110
{
111-
#if defined(PY_DEBUG)
111+
#if defined(Py_DEBUG)
112112
_PyPegen_clear_memo_statistics();
113113
#endif
114114
Py_RETURN_NONE;
@@ -117,7 +117,7 @@ clear_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
117117
static PyObject *
118118
get_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
119119
{
120-
#if defined(PY_DEBUG)
120+
#if defined(Py_DEBUG)
121121
return _PyPegen_get_memo_statistics();
122122
#else
123123
Py_RETURN_NONE;
@@ -128,7 +128,7 @@ get_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
128128
static PyObject *
129129
dump_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
130130
{
131-
#if defined(PY_DEBUG)
131+
#if defined(Py_DEBUG)
132132
PyObject *list = _PyPegen_get_memo_statistics();
133133
if (list == NULL) {
134134
return NULL;

0 commit comments

Comments
 (0)