summaryrefslogtreecommitdiff
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:17:58 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:17:58 +0200
commitf4934ea77da38516731a75fbf9458b248d26dd81 (patch)
tree9fe19276fac7661f433f86673ff7862663ed7693 /Modules/_elementtree.c
parent5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff)
downloadcpython-git-f4934ea77da38516731a75fbf9458b248d26dd81.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 '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 85ffca206b..1cdddaf0fb 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3686,11 +3686,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);