diff options
Diffstat (limited to 'pyflakes/checker.py')
-rw-r--r-- | pyflakes/checker.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py index d6d057e..0d65506 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -669,6 +669,10 @@ class DummyNode(object): self.col_offset = col_offset +class DetectClassScopedMagic: + names = dir() + + # Globally defined names which are not attributes of the builtins module, or # are only present on some platforms. _MAGIC_GLOBALS = ['__file__', '__builtins__', 'WindowsError'] @@ -1231,7 +1235,7 @@ class Checker(object): # the special name __path__ is valid only in packages return - if name == '__module__' and isinstance(self.scope, ClassScope): + if name in DetectClassScopedMagic.names and isinstance(self.scope, ClassScope): return # protected with a NameError handler? |