1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Description: Adding support for python2-only function execfile()
Author: Stewart Ferguson <stew@ferg.aero>
Forwarded: https://github.com/enthought/apptools/pull/84
Last-Update: 2019-01-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -13,6 +13,16 @@
import sys, os
+def execfile(filepath, globals=None, locals=None):
+ if globals is None:
+ globals = {}
+ globals.update({
+ "__file__": filepath,
+ "__name__": "__main__",
+ })
+ with open(filepath, 'rb') as file:
+ exec(compile(file.read(), filepath, 'exec'), globals, locals)
+
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
|