summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-25 15:16:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-02-25 15:16:56 (GMT)
commitc8fd9ce73dd5a02cbd740c2732ac784d18f20656 (patch)
tree517a4cb53875fc1b0fd97ca7d43ad10c4a596f04 /Objects
parent1313af2340d313ec64041193a9d1225271790e32 (diff)
parentb808d590a24066bc03d21b55ed5e890a012477a8 (diff)
downloadcpython-c8fd9ce73dd5a02cbd740c2732ac784d18f20656.zip
cpython-c8fd9ce73dd5a02cbd740c2732ac784d18f20656.tar.gz
cpython-c8fd9ce73dd5a02cbd740c2732ac784d18f20656.tar.bz2
merge 3.4 (#23515)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/listobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index e7c4c82..8f88d18 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1832,7 +1832,8 @@ merge_collapse(MergeState *ms)
assert(ms);
while (ms->n > 1) {
Py_ssize_t n = ms->n - 2;
- if (n > 0 && p[n-1].len <= p[n].len + p[n+1].len) {
+ if ((n > 0 && p[n-1].len <= p[n].len + p[n+1].len) ||
+ (n > 1 && p[n-2].len <= p[n-1].len + p[n].len)) {
if (p[n-1].len < p[n+1].len)
--n;
if (merge_at(ms, n) < 0)