From fea62cdc4ec9c493e8f3de76f257591072907a06 Mon Sep 17 00:00:00 2001 From: Maxwell Bernstein Date: Thu, 2 May 2019 16:42:11 -0700 Subject: [PATCH] Update Python/ast.c to PEP-384 --- Python/ast.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Python/ast.c b/Python/ast.c index 11524029ae26ee..46815c271b62d5 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -294,7 +294,7 @@ validate_expr(expr_ty exp, expr_context_ty ctx) if (!validate_constant(exp->v.Constant.value)) { PyErr_Format(PyExc_TypeError, "got an invalid type in Constant: %s", - Py_TYPE(exp->v.Constant.value)->tp_name); + _PyType_Name(Py_TYPE(exp->v.Constant.value))); return 0; } return 1; @@ -618,12 +618,11 @@ new_identifier(const char *n, struct compiling *c) identifier; if so, normalize to NFKC. */ if (!PyUnicode_IS_ASCII(id)) { PyObject *id2; - _Py_IDENTIFIER(NFKC); if (!c->c_normalize && !init_normalization(c)) { Py_DECREF(id); return NULL; } - PyObject *form = _PyUnicode_FromId(&PyId_NFKC); + PyObject *form = PyUnicode_InternFromString("NFKC"); if (form == NULL) { Py_DECREF(id); return NULL; @@ -637,7 +636,7 @@ new_identifier(const char *n, struct compiling *c) PyErr_Format(PyExc_TypeError, "unicodedata.normalize() must return a string, not " "%.200s", - Py_TYPE(id2)->tp_name); + _PyType_Name(Py_TYPE(id2))); Py_DECREF(id2); return NULL; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy