diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 08:17:58 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 08:17:58 (GMT) |
commit | f4934ea77da38516731a75fbf9458b248d26dd81 (patch) | |
tree | 9fe19276fac7661f433f86673ff7862663ed7693 /Python/symtable.c | |
parent | 5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff) | |
download | cpython-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/symtable.c')
-rw-r--r-- | Python/symtable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 1591a20..adca2da 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; |