cpython: 3ceeccbc2c3b (original) (raw)

Mercurial > cpython

changeset 69562:3ceeccbc2c3b 2.7

#6780: fix starts/endswith error message to mention that tuples are accepted too. [#6780]

Ezio Melotti
date Tue, 26 Apr 2011 05:12:51 +0300
parents 48758cd0769b
children a3b4887edba4
files Lib/test/test_str.py Lib/test/test_unicode.py Misc/NEWS Objects/stringobject.c Objects/unicodeobject.c
diffstat 5 files changed, 46 insertions(+), 6 deletions(-)[+] [-] Lib/test/test_str.py 13 Lib/test/test_unicode.py 11 Misc/NEWS 3 Objects/stringobject.c 12 Objects/unicodeobject.c 13

line wrap: on

line diff

--- a/Lib/test/test_str.py +++ b/Lib/test/test_str.py @@ -414,7 +414,18 @@ class StrTest( self.assertEqual('Andr\202 x'.decode('ascii', 'replace'), 'Andr\202 x'.decode(encoding='ascii', errors='replace')) -

def test_main(): test_support.run_unittest(StrTest)

--- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -442,6 +442,17 @@ class UnicodeTest( return u'\u1234' self.assertEqual('%s' % Wrapper(), u'\u1234')

+ @test_support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_format_float(self): # should not format with a comma, but always with C locale

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -9,6 +9,9 @@ What's New in Python 2.7.2? Core and Builtins ----------------- +- Issue #6780: fix starts/endswith error message to mention that tuples are

--- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -2918,8 +2918,12 @@ string_startswith(PyStringObject *self, Py_RETURN_FALSE; } result = _string_tailmatch(self, subobj, start, end, -1);

} @@ -2958,8 +2962,12 @@ string_endswith(PyStringObject *self, Py Py_RETURN_FALSE; } result = _string_tailmatch(self, subobj, start, end, +1);

}

--- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -7666,8 +7666,12 @@ unicode_startswith(PyUnicodeObject *self Py_RETURN_FALSE; } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj);

-