* [PATCH] build: eliminate use of python execfile command
@ 2015-01-03 13:21 David Bremner
2015-01-03 14:05 ` Tomi Ollila
2015-01-04 9:32 ` David Bremner
0 siblings, 2 replies; 3+ messages in thread
From: David Bremner @ 2015-01-03 13:21 UTC (permalink / raw)
To: notmuch
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] build: eliminate use of python execfile command
2015-01-03 13:21 [PATCH] build: eliminate use of python execfile command David Bremner
@ 2015-01-03 14:05 ` Tomi Ollila
2015-01-04 9:32 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2015-01-03 14:05 UTC (permalink / raw)
To: David Bremner, notmuch
On Sat, Jan 03 2015, David Bremner <david@tethera.net> wrote:
> 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.
Looks good, tests pass -- you could amend the commit message by adding one lost newline.
Tomi
> ---
> 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
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] build: eliminate use of python execfile command
2015-01-03 13:21 [PATCH] build: eliminate use of python execfile command David Bremner
2015-01-03 14:05 ` Tomi Ollila
@ 2015-01-04 9:32 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2015-01-04 9:32 UTC (permalink / raw)
To: notmuch
David Bremner <david@tethera.net> writes:
> As discussed in
> id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking@tremily.us,
> execfile is unavailable in python3.
Pushed, with commit message reformatted.
d
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-04 9:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-03 13:21 [PATCH] build: eliminate use of python execfile command David Bremner
2015-01-03 14:05 ` Tomi Ollila
2015-01-04 9:32 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).