Mercurial > cpython-lru_cache-weakref
diff Objects/complexobject.c @ 83433:edf029fc9591
Close #17694: Add minimum length to _PyUnicodeWriter
* Add also min_char attribute to _PyUnicodeWriter structure (currently unused)
* _PyUnicodeWriter_Init() has no more argument (except the writer itself):
min_length and overallocate must be set explicitly
* In error handlers, only enable overallocation if the replacement string
is longer than 1 character
* CJK decoders don't use overallocation anymore
* Set min_length, instead of preallocating memory using
_PyUnicodeWriter_Prepare(), in many decoders
* _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Wed, 17 Apr 2013 23:02:17 +0200 |
| parents | 399e59ad0a70 |
| children | e7f6cef7a4cc |
line wrap: on
line diff
--- a/Objects/complexobject.c Wed Apr 17 21:27:17 2013 +0100 +++ b/Objects/complexobject.c Wed Apr 17 23:02:17 2013 +0200 @@ -705,7 +705,7 @@ if (!PyArg_ParseTuple(args, "U:__format__", &format_spec)) return NULL; - _PyUnicodeWriter_Init(&writer, 0); + _PyUnicodeWriter_Init(&writer); ret = _PyComplex_FormatAdvancedWriter( &writer, self,
