summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
commitf4934ea77da38516731a75fbf9458b248d26dd81 (patch)
tree9fe19276fac7661f433f86673ff7862663ed7693 /Python/ast.c
parent5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff)
downloadcpython-f4934ea77da38516731a75fbf9458b248d26dd81.zip
cpython-f4934ea77da38516731a75fbf9458b248d26dd81.tar.gz
cpython-f4934ea77da38516731a75fbf9458b248d26dd81.tar.bz2
Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 6da33f7..5b7ed7c 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;
}