363 Commits

Author SHA1 Message Date
Serhiy Storchaka
c26b19d5c7 Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)
(cherry picked from commit b879fe82e7)
2017-04-08 11:18:14 +03:00
Serhiy Storchaka
bf4bb2e430 bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abf)
2017-03-30 19:46:59 +03:00
Benjamin Peterson
2f8bfef158 replace PY_SIZE_MAX with SIZE_MAX 2016-09-07 09:26:18 -07:00
Benjamin Peterson
05448a62ae merge 3.5 2016-09-06 17:58:44 -07:00
Benjamin Peterson
5a7d923e75 make sure to not call memcpy with a NULL second argument 2016-09-06 17:58:25 -07:00
Mark Dickinson
5d13238f6e Issue #27662: don't use PY_SIZE_MAX for overflow checking in List_New. Patch by Xiang Zhang. 2016-08-21 08:55:15 +01:00
Martin Panter
b93d8637a6 Issue #1621: Avoid signed overflow in list and tuple operations
Patch by Xiang Zhang.
2016-07-25 02:39:20 +00:00
Serhiy Storchaka
7e160ce356 Issue #23034: The output of a special Python build with defined COUNT_ALLOCS,
SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by  default.  It can
be re-enabled using the "-X showalloccount" option.  It now outputs to stderr
instead of stdout.
2016-07-03 21:03:53 +03:00
Serhiy Storchaka
f01e408c16 Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
2016-04-10 18:12:01 +03:00
Serhiy Storchaka
ec39756960 Issue #22570: Renamed Py_SETREF to Py_XSETREF. 2016-04-06 09:50:03 +03:00
Serhiy Storchaka
ab479c49d3 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:41:15 +03:00
Serhiy Storchaka
fbb1c5ee06 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
Raymond Hettinger
0dceb91866 Tests versus zero are more compact than tests versus -1. 2016-01-25 10:33:30 -08:00
Serhiy Storchaka
1ed017ae92 Issue #20440: Cleaning up the code by using Py_SETREF and Py_CLEAR.
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner.
This patch doesn't fix bugs and hence there is no need to backport it.
2015-12-27 15:51:32 +02:00
Serhiy Storchaka
5c4064e8bd Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:05:25 +02:00
Benjamin Peterson
a30e2256f7 merge 3.4 (#24044) 2015-04-23 17:06:45 -04:00
Benjamin Peterson
bd91ee9cd7 merge 3.3 (#24044) 2015-04-23 17:06:33 -04:00
Benjamin Peterson
51454a62e2 merge 3.2 (#24044) 2015-04-23 17:05:07 -04:00
Benjamin Peterson
0823ffb2fb properly handle malloc failure (closes #24044)
Patch by Christian Heimes.
2015-04-23 17:04:36 -04:00
Benjamin Peterson
c8fd9ce73d merge 3.4 (#23515) 2015-02-25 10:16:56 -05:00
Benjamin Peterson
b808d590a2 fix merge_collapse to actually maintain the invariant it purports to (closes #23515)
See
de Gouw, Stijn and Rot, Jurriaan and de Boer, Frank S and Bubel, Richard and Hähnle, Reiner
"OpenJDK’s java.utils.Collection.sort() is broken: The good, the bad and the worst case"
2015-02-25 10:12:26 -05:00
Terry Jan Reedy
ffff1440d1 Issue #22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename' for bytearrays.
Original patch by Claudiu Popa.
2014-08-02 01:30:37 -04:00
Benjamin Peterson
af9049ebbc merge 3.3 2014-03-15 12:21:47 -05:00
Benjamin Peterson
4a42cd48d5 avoid referencing past the bounds of an array 2014-03-15 12:21:28 -05:00
Benjamin Peterson
1aca78da62 merge 3.3 2014-03-14 21:54:41 -05:00