From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 40925138010 for ; Tue, 2 Oct 2012 20:30:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 18BF4E0230; Tue, 2 Oct 2012 20:30:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DF30BE0329 for ; Tue, 2 Oct 2012 20:30:24 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 457FF33CBE3 for ; Tue, 2 Oct 2012 20:30:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D08BEE5436 for ; Tue, 2 Oct 2012 20:30:22 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1349209377.6571d8b160e2e5d10ef76fcc5fba288d3e494d3e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/cache/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/cache/mappings.py X-VCS-Directories: pym/portage/cache/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 6571d8b160e2e5d10ef76fcc5fba288d3e494d3e X-VCS-Branch: master Date: Tue, 2 Oct 2012 20:30:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1bcf6f8d-5c3b-4757-97c6-e655de601880 X-Archives-Hash: 508b339d45d3cef9e8b91cd7252df73f commit: 6571d8b160e2e5d10ef76fcc5fba288d3e494d3e Author: Zac Medico gentoo org> AuthorDate: Tue Oct 2 20:22:57 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Oct 2 20:22:57 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6571d8b1 OrderedDict: fix setitem bug #436974 This fixes some strange behavior triggered during fetch, which is only observable with Python 2.6 since it doesn't have collections.OrderedDict. --- pym/portage/cache/mappings.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index bc8ce9a..cd39a6e 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -199,10 +199,10 @@ class OrderedDict(UserDict): return iter(self._order) def __setitem__(self, key, item): - if key in self: - self._order.remove(key) + new_key = key not in self UserDict.__setitem__(self, key, item) - self._order.append(key) + if new_key: + self._order.append(key) def __delitem__(self, key): UserDict.__delitem__(self, key)