From f4934ea77da38516731a75fbf9458b248d26dd81 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 16 Nov 2016 10:17:58 +0200 Subject: Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions. --- Python/ast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/ast.c') diff --git a/Python/ast.c b/Python/ast.c index 6da33f73a0..5b7ed7c035 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -876,14 +876,14 @@ forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks) { assert(PyUnicode_Check(name)); - if (PyUnicode_CompareWithASCIIString(name, "__debug__") == 0) { + if (_PyUnicode_EqualToASCIIString(name, "__debug__")) { ast_error(c, n, "assignment to keyword"); return 1; } if (full_checks) { const char **p; for (p = FORBIDDEN; *p; p++) { - if (PyUnicode_CompareWithASCIIString(name, *p) == 0) { + if (_PyUnicode_EqualToASCIIString(name, *p)) { ast_error(c, n, "assignment to keyword"); return 1; } -- cgit v1.2.1