Skip to content

Commit 3985150

Browse files
committed
removed try block in _infer_name_module
1 parent aeccde6 commit 3985150

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pylint/checkers/variables.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,11 @@ def _infer_name_module(node: nodes.Import, name: str) -> Generator[InferenceResu
207207
'.' in node.names[0][0] and
208208
node.names[0][0].startswith(node.names[0][1] + '.')):
209209

210-
try:
211-
module = next(node.infer(context, asname=False), None)
212-
if isinstance(module, nodes.Module):
213-
yield module
214-
return
215-
except astroid.InferenceError:
216-
pass
217-
210+
module = next(node.infer(context, asname=False), None)
211+
if isinstance(module, nodes.Module):
212+
yield module
213+
return
214+
218215
yield from node.infer(context, asname=False)
219216

220217

0 commit comments

Comments
 (0)