diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-01-26 10:11:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 10:11:35 (GMT) |
commit | dcd28b5c35dda8e2cb7c5f66450f2aff0948c001 (patch) | |
tree | 901906c90bedd8d602dcdfd114230b2dd903301c /Parser | |
parent | d0f7f5c41d71758c59f9372a192e927d73cf7c27 (diff) | |
download | cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.zip cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.tar.gz cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.tar.bz2 |
gh-114569: Use PyMem_* APIs for most non-PyObject uses (#114574)
Fix usage in Modules, Objects, and Parser subdirectories.
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/lexer/lexer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Parser/lexer/lexer.c b/Parser/lexer/lexer.c index ebf7686..82b0e4e 100644 --- a/Parser/lexer/lexer.c +++ b/Parser/lexer/lexer.c @@ -129,7 +129,7 @@ set_fstring_expr(struct tok_state* tok, struct token *token, char c) { if (hash_detected) { Py_ssize_t input_length = tok_mode->last_expr_size - tok_mode->last_expr_end; - char *result = (char *)PyObject_Malloc((input_length + 1) * sizeof(char)); + char *result = (char *)PyMem_Malloc((input_length + 1) * sizeof(char)); if (!result) { return -1; } @@ -154,7 +154,7 @@ set_fstring_expr(struct tok_state* tok, struct token *token, char c) { result[j] = '\0'; // Null-terminate the result string res = PyUnicode_DecodeUTF8(result, j, NULL); - PyObject_Free(result); + PyMem_Free(result); } else { res = PyUnicode_DecodeUTF8( tok_mode->last_expr_buffer, |