[PATCH] doc/prerst2man.py: swap execfile with an exec call

Gaute Hope eg at gaute.vetsj.com
Sat Aug 9 06:39:51 PDT 2014


at some point in python 3.* execfile was removed. per
http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
the execefile has been replaced in the same manner as python 2to3 helper
script would do.

tested on python 3.4.1 and 2.7.8.
---
 doc/prerst2man.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/prerst2man.py b/doc/prerst2man.py
index 437dea9..3f85c0c 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")
+filename = sourcedir + "/conf.py"
+exec(compile(open(filename, "rb").read(), filename, 'exec'))
 
 
 def header(file, startdocname, command, description, authors, section):
-- 
2.0.3



More information about the notmuch mailing list