[{"id":1768823,"web_url":"http://patchwork.ozlabs.org/comment/1768823/","msgid":"<c2615a2d-890d-93bd-d938-9d118da78047@wwwdotorg.org>","list_archive_url":null,"date":"2017-09-14T20:26:22","subject":"Re: [U-Boot] [PATCH 3/8] test/py: Import 'configparser' lower case\n\tto be python 3.x safe","submitter":{"id":12517,"url":"http://patchwork.ozlabs.org/api/people/12517/","name":"Stephen Warren","email":"swarren@wwwdotorg.org"},"content":"On 09/14/2017 02:06 PM, Paul Burton wrote:\n> In python 3.x the configparser module is named with all lower case.\n> Import it as such in order to avoid errors when running on python 3.x,\n> and fall back to the CamelCase version in order to keep working with\n> python 2.x.\n\n> diff --git a/test/py/conftest.py b/test/py/conftest.py\n\n> +try:\n> +    import configparser as ConfigParser\n> +except:\n> +    import ConfigParser\n\nNit: Since Python 3 is the future, I wonder if we want to bias the code \ntowards it:\n\ntry:\n     import configparser\nexcept:\n     import ConfigParser as configparser\n\n... and conver the one use of ConfigParser below to configparser?\n\nSimilarly, it might make sense to do something similar in the next \npatch; Python 3 code in \"try\", and Python 2 compatibility code in \"except\".\n\nThat said, the code works fine either way, so I don't care much whether \nyou make this change.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xtVRv6sQzz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 06:26:35 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 90FF7C21EB4; Thu, 14 Sep 2017 20:26:33 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5440DC21D7A;\n\tThu, 14 Sep 2017 20:26:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 44662C21D7A; Thu, 14 Sep 2017 20:26:31 +0000 (UTC)","from avon.wwwdotorg.org (avon.wwwdotorg.org [104.237.132.123])\n\tby lists.denx.de (Postfix) with ESMTPS id D2F7CC21D5B\n\tfor <u-boot@lists.denx.de>; Thu, 14 Sep 2017 20:26:30 +0000 (UTC)","from [10.20.204.51] (thunderhill.nvidia.com [216.228.112.22])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby avon.wwwdotorg.org (Postfix) with ESMTPSA id 578561C02C7;\n\tThu, 14 Sep 2017 14:26:29 -0600 (MDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","X-Virus-Status":"Clean","X-Virus-Scanned":"clamav-milter 0.99.2 at avon.wwwdotorg.org","To":"Paul Burton <paul.burton@imgtec.com>","References":"<20170914200634.17818-1-paul.burton@imgtec.com>\n\t<20170914200634.17818-4-paul.burton@imgtec.com>","From":"Stephen Warren <swarren@wwwdotorg.org>","Message-ID":"<c2615a2d-890d-93bd-d938-9d118da78047@wwwdotorg.org>","Date":"Thu, 14 Sep 2017 14:26:22 -0600","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170914200634.17818-4-paul.burton@imgtec.com>","Content-Language":"en-GB","Cc":"u-boot@lists.denx.de, Stephen Warren <swarren@nvidia.com>, =?utf-8?q?S?=\n\t=?utf-8?q?tefan_Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>","Subject":"Re: [U-Boot] [PATCH 3/8] test/py: Import 'configparser' lower case\n\tto be python 3.x safe","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]