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 2571A13888F for ; Thu, 29 Oct 2015 00:29:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF8D4E07FE; Thu, 29 Oct 2015 00:29:11 +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 7194EE07FE for ; Thu, 29 Oct 2015 00:29:11 +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 37FC4340A97 for ; Thu, 29 Oct 2015 00:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 72917184E for ; Thu, 29 Oct 2015 00:28:57 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1446078466.1cb701ee64e06badb16a0086bb4e46184633c5da.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/config.py X-VCS-Directories: catalyst/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 1cb701ee64e06badb16a0086bb4e46184633c5da X-VCS-Branch: master Date: Thu, 29 Oct 2015 00:28:57 +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: a41730c2-0f21-4929-911d-69ab79dea2a2 X-Archives-Hash: e87ad83f993f9e95f70e23879866c98f commit: 1cb701ee64e06badb16a0086bb4e46184633c5da Author: Mike Frysinger gentoo org> AuthorDate: Thu Oct 29 00:27:46 2015 +0000 Commit: Mike Frysinger 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)