Skip to content

Commit 76a9b59

Browse files
committed
DOC: standardize on exc for arg/variable name
1 parent 0cbd53f commit 76a9b59

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/api/api_changes/2017-08_TAC.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ restore the previous behavior pass ``None`` ::
2121

2222
A function which take and ``Exception`` as its only argument may also be passed ::
2323

24-
def maybe_reraise(excp):
25-
if isinstance(excp, RuntimeError):
24+
def maybe_reraise(exc):
25+
if isinstance(exc, RuntimeError):
2626
pass
2727
else:
28-
raise excp
28+
raise exc
2929

3030
cb = CallbackRegistry(exception_handler=maybe_reraise)

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class CallbackRegistry(object):
296296
exception_handler : callable, optional
297297
If provided must have signature ::
298298
299-
def handler(exception: Exception) -> None:
299+
def handler(exc: Exception) -> None:
300300
301301
If not None this function will be called with any `Exception`
302302
subclass raised by the callbacks in `CallbackRegistry.process`.
@@ -391,9 +391,9 @@ def process(self, s, *args, **kwargs):
391391
self._remove_proxy(proxy)
392392
# this does not capture KeyboardInterrupt, SystemExit,
393393
# and GeneratorExit
394-
except Exception as e:
394+
except Exception as exc:
395395
if self.exception_handler is not None:
396-
self.exception_handler(e)
396+
self.exception_handler(exc)
397397
else:
398398
raise
399399

0 commit comments

Comments
 (0)