[pypy-commit] pypy unicode-utf8-py3: tweak descr_capitalize

mattip pypy.commits at gmail.com
Sun Dec 2 11:52:20 EST 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95404:0d983e9b4100
Date: 2018-12-02 08:51 -0800
http://bitbucket.org/pypy/pypy/changeset/0d983e9b4100/

Log:	tweak descr_capitalize

diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -849,8 +849,7 @@
         return W_UnicodeObject(self._utf8[byte_start:byte_stop], stop - start)
 
     def descr_capitalize(self, space):
-        value = self._utf8
-        if len(value) == 0:
+        if self._len() == 0:
             return self._empty()
 
         builder = rutf8.Utf8StringBuilder(len(self._utf8))


More information about the pypy-commit mailing list