From 260d2ac9cf8290e162465aab21cadd9d342f6d51 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Mon, 16 Oct 2017 00:28:00 -0700 Subject: [PATCH] Fix NameError: name 'exc' is not defined --- lib/matplotlib/backend_bases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index cf7889678553..d7c6e61e6c95 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2606,7 +2606,7 @@ def _get_uniform_gridstate(ticks): elif scalex == 'linear': try: ax.set_xscale('log') - except ValueError: + except ValueError as exc: warnings.warn(str(exc)) ax.set_xscale('linear') ax.figure.canvas.draw_idle()