diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 08:19:20 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 08:19:20 (GMT) |
commit | 3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1 (patch) | |
tree | a1a58a83f9d60f7d5d02e5d116bb76ee13c42254 /Modules/_elementtree.c | |
parent | 21060105d99a9153db44dd88eb750965392fd966 (diff) | |
parent | f4934ea77da38516731a75fbf9458b248d26dd81 (diff) | |
download | cpython-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.c | 6 |
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); |