aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:19:20 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 10:19:20 +0200
commit3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1 (patch)
treea1a58a83f9d60f7d5d02e5d116bb76ee13c42254 /Modules/_io/winconsoleio.c
parentIssue #26935: Fix broken Android dup2() in test_os (diff)
parentIssue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualT... (diff)
downloadcpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.tar.gz
cpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.tar.bz2
cpython-3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1.zip
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/winconsoleio.c')
-rw-r--r--Modules/_io/winconsoleio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index 4666a3867ad..7b00a9eb6d6 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -93,11 +93,11 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
}
char m = '\0';
- if (PyUnicode_CompareWithASCIIString(decoded_upper, "CONIN$") == 0) {
+ if (_PyUnicode_EqualToASCIIString(decoded_upper, "CONIN$")) {
m = 'r';
- } else if (PyUnicode_CompareWithASCIIString(decoded_upper, "CONOUT$") == 0) {
+ } else if (_PyUnicode_EqualToASCIIString(decoded_upper, "CONOUT$")) {
m = 'w';
- } else if (PyUnicode_CompareWithASCIIString(decoded_upper, "CON") == 0) {
+ } else if (_PyUnicode_EqualToASCIIString(decoded_upper, "CON")) {
m = 'x';
}