summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:19:20 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:19:20 +0200
commitc0797803c0d4303489709f02078c8c6adc4eed36 (patch)
treed3b5afe679e3030eecf9372a6c6bdee5bc5f39e0 /Python/symtable.c
parentcf0a090abb7d7c2a3baf33a5183c0842dd316608 (diff)
parent78779b765c2d7f89fab3868b77b6a6522c55ee4c (diff)
downloadcpython-c0797803c0d4303489709f02078c8c6adc4eed36.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 bf30eccdab..6165cfe162 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;