summaryrefslogtreecommitdiff
path: root/doc/sphinxext
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sphinxext')
-rw-r--r--doc/sphinxext/plot_directive.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/sphinxext/plot_directive.py b/doc/sphinxext/plot_directive.py
index a91b436a7..7fa827664 100644
--- a/doc/sphinxext/plot_directive.py
+++ b/doc/sphinxext/plot_directive.py
@@ -456,8 +456,8 @@ def run_code(code, code_path, ns=None):
if ns is None:
ns = {}
if not ns:
- exec setup.config.plot_pre_code in ns
- exec code in ns
+ exec(setup.config.plot_pre_code, ns)
+ exec(code, ns)
except (Exception, SystemExit) as err:
raise PlotError(traceback.format_exc())
finally: