summaryrefslogtreecommitdiff
path: root/doc/sphinxext/plot_directive.py
diff options
context:
space:
mode:
authorseberg <sebastian@sipsolutions.net>2013-02-27 14:37:36 -0800
committerseberg <sebastian@sipsolutions.net>2013-02-27 14:37:36 -0800
commite84885aa39057235a8cb53558f05a07cb6da4965 (patch)
tree1501c04214cbf846badc7988de6ff5f2094c9940 /doc/sphinxext/plot_directive.py
parent208072f817ac14f041569f0123d3434bc9e0daba (diff)
parentc6397ba59fba25989b0ba37ad8267325757f1dcd (diff)
downloadnumpy-e84885aa39057235a8cb53558f05a07cb6da4965.tar.gz
Merge pull request #3028 from charris/2to3-except-update
2to3: Update `except Exception, msg:` syntax in files not in numpy/ .
Diffstat (limited to 'doc/sphinxext/plot_directive.py')
-rw-r--r--doc/sphinxext/plot_directive.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/sphinxext/plot_directive.py b/doc/sphinxext/plot_directive.py
index 80801e798..fad7a76d7 100644
--- a/doc/sphinxext/plot_directive.py
+++ b/doc/sphinxext/plot_directive.py
@@ -291,7 +291,7 @@ def run(arguments, content, options, state_machine, state, lineno):
results = makefig(code, source_file_name, build_dir, output_base,
config)
errors = []
- except PlotError, err:
+ except PlotError as err:
reporter = state.memo.reporter
sm = reporter.system_message(
2, "Exception occurred in plotting %s: %s" % (output_base, err),
@@ -458,7 +458,7 @@ def run_code(code, code_path, ns=None):
if not ns:
exec setup.config.plot_pre_code in ns
exec code in ns
- except (Exception, SystemExit), err:
+ except (Exception, SystemExit) as err:
raise PlotError(traceback.format_exc())
finally:
os.chdir(pwd)
@@ -565,7 +565,7 @@ def makefig(code, code_path, output_dir, output_base, config):
for format, dpi in formats:
try:
figman.canvas.figure.savefig(img.filename(format), dpi=dpi)
- except exceptions.BaseException, err:
+ except exceptions.BaseException as err:
raise PlotError(traceback.format_exc())
img.formats.append(format)