From f4934ea77da38516731a75fbf9458b248d26dd81 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 16 Nov 2016 10:17:58 +0200 Subject: Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions. --- Modules/_elementtree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Modules/_elementtree.c') 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); -- cgit v1.2.1