Add __debuggerskip__ as special local
__debuggerskip__ is a special variable used by IPython, similar to
__tracebackhide__.
diff --git a/pyflakes/checker.py b/pyflakes/checker.py
index 754ab30..2b0a23d 100644
--- a/pyflakes/checker.py
+++ b/pyflakes/checker.py
@@ -548,7 +548,7 @@
"""
usesLocals = False
alwaysUsed = {'__tracebackhide__', '__traceback_info__',
- '__traceback_supplement__'}
+ '__traceback_supplement__', '__debuggerskip__'}
def __init__(self):
super().__init__()
diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py
index aebdcea..f81a09e 100644
--- a/pyflakes/test/test_other.py
+++ b/pyflakes/test/test_other.py
@@ -1349,6 +1349,16 @@
__tracebackhide__ = True
""")
+ def test_debuggerskipSpecialVariable(self):
+ """
+ Do not warn about unused local variable __debuggerskip__, which is
+ a special variable for IPython.
+ """
+ self.flakes("""
+ def helper():
+ __debuggerskip__ = True
+ """)
+
def test_ifexp(self):
"""
Test C{foo if bar else baz} statements.