mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
This commit is contained in:
parent
5ebff7b300
commit
f4934ea77d
21 changed files with 120 additions and 75 deletions
|
@ -99,7 +99,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
|
|||
if (s->kind == ImportFrom_kind) {
|
||||
identifier modname = s->v.ImportFrom.module;
|
||||
if (modname &&
|
||||
!PyUnicode_CompareWithASCIIString(modname, "__future__")) {
|
||||
_PyUnicode_EqualToASCIIString(modname, "__future__")) {
|
||||
if (done) {
|
||||
PyErr_SetString(PyExc_SyntaxError,
|
||||
ERR_LATE_FUTURE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue