summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:19:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:19:57 (GMT)
commit1a73bf365e9664f8dd3357ebbb78ceaa79df2172 (patch)
tree87917a1a572c2f3c5a574d6a96a9879970a941d9 /Python/symtable.c
parent1e2784e0b3cb8d9050bffb338b2de838fbba13a2 (diff)
parent3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1 (diff)
downloadcpython-1a73bf365e9664f8dd3357ebbb78ceaa79df2172.zip
cpython-1a73bf365e9664f8dd3357ebbb78ceaa79df2172.tar.gz
cpython-1a73bf365e9664f8dd3357ebbb78ceaa79df2172.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/symtable.c')
-rw-r--r--Python/symtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index bf30ecc..6165cfe 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1503,7 +1503,7 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
/* Special-case super: it counts as a use of __class__ */
if (e->v.Name.ctx == Load &&
st->st_cur->ste_type == FunctionBlock &&
- !PyUnicode_CompareWithASCIIString(e->v.Name.id, "super")) {
+ _PyUnicode_EqualToASCIIString(e->v.Name.id, "super")) {
if (!GET_IDENTIFIER(__class__) ||
!symtable_add_def(st, __class__, USE))
VISIT_QUIT(st, 0);
@@ -1652,7 +1652,7 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
store_name = name;
Py_INCREF(store_name);
}
- if (PyUnicode_CompareWithASCIIString(name, "*")) {
+ if (!_PyUnicode_EqualToASCIIString(name, "*")) {
int r = symtable_add_def(st, store_name, DEF_IMPORT);
Py_DECREF(store_name);
return r;