summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:17:58 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:17:58 +0200
commitf4934ea77da38516731a75fbf9458b248d26dd81 (patch)
tree9fe19276fac7661f433f86673ff7862663ed7693 /Python/symtable.c
parent5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff)
downloadcpython-git-f4934ea77da38516731a75fbf9458b248d26dd81.tar.gz
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 1591a20f50..adca2dab67 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1472,7 +1472,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);
@@ -1621,7 +1621,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;