summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-27 17:27:33 -0400
committerBrett Cannon <brett@python.org>2012-04-27 17:27:33 -0400
commit19b409a3410605380c9fdcb2e35511c9dff53fa6 (patch)
tree03bf571ef120866dc95b8340419511ba05a33587
parentefad00d52041fedbff5d7cfadd163e228b4af519 (diff)
parent94d558b063d63eda7a898ab31b0bc2e4d0294bf1 (diff)
downloadcpython-git-19b409a3410605380c9fdcb2e35511c9dff53fa6.tar.gz
merge
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 60b0a1fbbd..3afb799fc3 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1985,6 +1985,9 @@ _PyUnicode_FindMaxChar(PyObject *unicode, Py_ssize_t start, Py_ssize_t end)
if (start == end)
return 127;
+ if (PyUnicode_IS_ASCII(unicode))
+ return 127;
+
kind = PyUnicode_KIND(unicode);
startptr = PyUnicode_DATA(unicode);
endptr = (char *)startptr + end * kind;