summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-08-26 22:09:27 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2015-08-26 22:09:27 +0300
commit596acc38bc6187dd7c3e05dffa0164f7d9b87dc8 (patch)
tree88256ac8aa8c38a3b6a36d2da9e3b9b154ffb3fe /pylint/utils.py
parent90755257e2a2c1a9b45b1a7e5470eef760fe6a90 (diff)
downloadpylint-596acc38bc6187dd7c3e05dffa0164f7d9b87dc8.tar.gz
Use the new node names for the visit and leave methods
Also, emit a PendingDeprecationWarning if the old names are still used, this support being removed in pylint 2.0.
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index 42f21d1..c918783 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -905,6 +905,16 @@ class PyLintASTWalker(object):
if old_cid:
visit_events = self.visit_events.get(old_cid)
leave_events = self.leave_events.get(old_cid)
+ if visit_events or leave_events:
+ msg = ("Implemented method {meth}_{old} instead of {meth}_{new}. "
+ "This will be supported until Pylint 2.0.")
+ if visit_events:
+ warnings.warn(msg.format(meth="visit", old=old_cid, new=cid),
+ PendingDeprecationWarning)
+ if leave_events:
+ warnings.warn(msg.format(meth="leave", old=old_cid, new=cid),
+ PendingDeprecationWarning)
+
if not visit_events:
visit_events = self.visit_events.get(cid)
if not leave_events: