summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
commitf4934ea77da38516731a75fbf9458b248d26dd81 (patch)
tree9fe19276fac7661f433f86673ff7862663ed7693 /Modules/_io
parent5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff)
downloadcpython-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 'Modules/_io')
-rw-r--r--Modules/_io/textio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 5d7f9ab..46c99b5 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1023,7 +1023,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
else if (PyUnicode_Check(res)) {
encodefuncentry *e = encodefuncs;
while (e->name != NULL) {
- if (!PyUnicode_CompareWithASCIIString(res, e->name)) {
+ if (_PyUnicode_EqualToASCIIString(res, e->name)) {
self->encodefunc = e->encodefunc;
break;
}