From: David Bremner Date: Sat, 3 Jan 2015 13:21:22 +0000 (+0100) Subject: [PATCH] build: eliminate use of python execfile command X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ae30c8427414b2da4395ad3a297d9f9bcc0eb9dc;p=notmuch-archives.git [PATCH] build: eliminate use of python execfile command --- diff --git a/ba/b9282c92598caee923ecff58c7f9e608591b1f b/ba/b9282c92598caee923ecff58c7f9e608591b1f new file mode 100644 index 000000000..f61b00c37 --- /dev/null +++ b/ba/b9282c92598caee923ecff58c7f9e608591b1f @@ -0,0 +1,87 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id A9CEE431FBC + for ; Sat, 3 Jan 2015 05:21:46 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id iAkXO9wAvqGg for ; + Sat, 3 Jan 2015 05:21:43 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 817F4431FB6 + for ; Sat, 3 Jan 2015 05:21:43 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1Y7OeF-0006PZ-6z; Sat, 03 Jan 2015 09:21:43 -0400 +Received: (nullmailer pid 2607 invoked by uid 1000); Sat, 03 Jan 2015 + 13:21:38 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] build: eliminate use of python execfile command +Date: Sat, 3 Jan 2015 14:21:22 +0100 +Message-Id: <1420291282-2553-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.3 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 03 Jan 2015 13:21:46 -0000 + +As discussed in +id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking@tremily.us, +execfile is unavailable in python3. + +The approach of this commit avoids modifying the python module path, +which is arguably preferable since it avoids potentially accidentally importing a module from the wrong place. +--- + devel/release-checks.sh | 2 +- + doc/prerst2man.py | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/devel/release-checks.sh b/devel/release-checks.sh +index 797d62a..ae02f55 100755 +--- a/devel/release-checks.sh ++++ b/devel/release-checks.sh +@@ -130,7 +130,7 @@ else + fi + + echo -n "Checking that python bindings version is $VERSION... " +-py_version=`python -c "execfile('$PV_FILE'); print __VERSION__"` ++py_version=`python -c "with open('$PV_FILE') as vf: exec(vf.read()); print __VERSION__"` + if [ "$py_version" = "$VERSION" ] + then + echo Yes. +diff --git a/doc/prerst2man.py b/doc/prerst2man.py +index 437dea9..968722a 100644 +--- a/doc/prerst2man.py ++++ b/doc/prerst2man.py +@@ -10,7 +10,8 @@ outdir = argv[2] + if not isdir(outdir): + makedirs(outdir, 0o755) + +-execfile(sourcedir + "/conf.py") ++with open(sourcedir + "/conf.py") as cf: ++ exec(cf.read()) + + + def header(file, startdocname, command, description, authors, section): +-- +2.1.3 +