Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89f8b80

Browse files
committed
use helpful PyUnicode_IS_ASCII macro
1 parent 5eda913 commit 89f8b80

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ new_identifier(const char* n, PyArena *arena)
537537
assert(PyUnicode_IS_READY(id));
538538
/* Check whether there are non-ASCII characters in the
539539
identifier; if so, normalize to NFKC. */
540-
if (PyUnicode_MAX_CHAR_VALUE((PyUnicodeObject *)id) >= 128) {
540+
if (PyUnicode_IS_ASCII(id)) {
541541
PyObject *m = PyImport_ImportModuleNoBlock("unicodedata");
542542
PyObject *id2;
543543
if (!m)

0 commit comments

Comments
 (0)