]> rtime.felk.cvut.cz Git - notmuch.git/commitdiff
build: eliminate use of python execfile command
authorDavid Bremner <david@tethera.net>
Sat, 3 Jan 2015 13:14:03 +0000 (14:14 +0100)
committerDavid Bremner <david@tethera.net>
Sat, 3 Jan 2015 14:18:54 +0000 (15:18 +0100)
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
doc/prerst2man.py

index 797d62acfca12f08b7bdbc8e986747844fa8ccff..ae02f557af23bda8488035367d2ae8eae5f95bb6 100755 (executable)
@@ -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.
index 437dea99b6e520697daff811009b890edd7abb2d..968722a1c750c620e24e1d5869269930bd3e5b96 100644 (file)
@@ -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):