summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:19:20 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:19:20 (GMT)
commit3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1 (patch)
treea1a58a83f9d60f7d5d02e5d116bb76ee13c42254 /Modules/_elementtree.c
parent21060105d99a9153db44dd88eb750965392fd966 (diff)
parentf4934ea77da38516731a75fbf9458b248d26dd81 (diff)
downloadcpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.zip
cpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.tar.gz
cpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.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/_elementtree.c')
-rw-r--r--Modules/_elementtree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 3362195..5937520 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3661,11 +3661,11 @@ xmlparser_getattro(XMLParserObject* self, PyObject* nameobj)
{
if (PyUnicode_Check(nameobj)) {
PyObject* res;
- if (PyUnicode_CompareWithASCIIString(nameobj, "entity") == 0)
+ if (_PyUnicode_EqualToASCIIString(nameobj, "entity"))
res = self->entity;
- else if (PyUnicode_CompareWithASCIIString(nameobj, "target") == 0)
+ else if (_PyUnicode_EqualToASCIIString(nameobj, "target"))
res = self->target;
- else if (PyUnicode_CompareWithASCIIString(nameobj, "version") == 0) {
+ else if (_PyUnicode_EqualToASCIIString(nameobj, "version")) {
return PyUnicode_FromFormat(
"Expat %d.%d.%d", XML_MAJOR_VERSION,
XML_MINOR_VERSION, XML_MICRO_VERSION);