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 36B721384B4 for ; Sat, 21 Nov 2015 01:34:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B8BCB21C02A; Sat, 21 Nov 2015 01:33:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 99F8121C011 for ; Sat, 21 Nov 2015 01:33:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CA3B9340A75 for ; Sat, 21 Nov 2015 01:33:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 310B01252 for ; Sat, 21 Nov 2015 01:33:45 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1446078466.1cb701ee64e06badb16a0086bb4e46184633c5da.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/config.py X-VCS-Directories: catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 1cb701ee64e06badb16a0086bb4e46184633c5da X-VCS-Branch: pending Date: Sat, 21 Nov 2015 01:33:45 +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: 95d0a495-8ae1-4c35-bc26-510b9ea1082f X-Archives-Hash: 0646a6b7ba4cc2b47c7d7dfccb77e338 commit: 1cb701ee64e06badb16a0086bb4e46184633c5da Author: Mike Frysinger gentoo org> AuthorDate: Thu Oct 29 00:27:46 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Oct 29 00:27:46 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1cb701ee config: tweak walking of settings for py3 Since py3 returns an iterator with dict.keys(), trying to add/del values in the loop will throw an exception. Run it through list() so we get a static copy to iterate over. catalyst/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/config.py b/catalyst/config.py index db81a96..5f72e15 100644 --- a/catalyst/config.py +++ b/catalyst/config.py @@ -97,7 +97,8 @@ class ParserBase(object): values[cur_array[0]] = cur_array[1:] if not self.empty_values: - for x in values.keys(): + # Make sure the list of keys is static since we modify inside the loop. + for x in list(values.keys()): # Delete empty key pairs if not values[x]: log.warning('No value set for key "%s"; deleting', x)