diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-11-13 08:47:17 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-11-13 08:47:17 +0100 |
commit | c9cf63ebaa671a34b7d9947eebd1d0da904dbcb0 (patch) | |
tree | a506c76e9695531165840fceb8d5dac5ae5218f7 /pylint/checkers/variables.py | |
parent | aa03cb7ce1209267c1f71e53a1095f9549bdc746 (diff) | |
download | pylint-git-c9cf63ebaa671a34b7d9947eebd1d0da904dbcb0.tar.gz |
Transform a runtime assertion into a check
Diffstat (limited to 'pylint/checkers/variables.py')
-rw-r--r-- | pylint/checkers/variables.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 3a13918a0..dbd8c23c6 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1144,6 +1144,8 @@ class VariablesChecker(BaseChecker): module = next(_infer_name_module(node, parts[0])) except astroid.ResolveError: continue + if not isinstance(module, astroid.Module): + continue self._check_module_attrs(node, module, parts[1:]) @utils.check_messages("no-name-in-module") @@ -1779,7 +1781,6 @@ class VariablesChecker(BaseChecker): given module if the latest access name corresponds to a module, return it """ - assert isinstance(module, astroid.Module), module while module_names: name = module_names.pop(0) if name == "__dict__": |