Method: pylint.checkers.variables._is_from_future_import
Calls: 503, Exceptions: 45, Paths: 3Back
Path 1: 443 calls (0.88)
ImportFrom (443)
'are_exclusive' (6) 'OrderedDict' (4) 'argv' (4) 'Path' (4) 'List' (3) 'LstT' (2) 'join' (2) 'OptionParser' (2) 're' (2) 'Sequence' (2)
None (443)
1def _is_from_future_import(stmt: nodes.ImportFrom, name: str) -> bool | None:
2 """Check if the name is a future import from another module."""
3 try:
4 module = stmt.do_import_module(stmt.modname)
5 except astroid.AstroidBuildingException:
6 return None
7
8 for local_node in module.locals.get(name, []):
9 if isinstance(local_node, nodes.ImportFrom) and local_node.modname == FUTURE:
10 return True
11 return None
Path 2: 45 calls (0.09)
ImportFrom (45)
'bar' (3) 'Bar' (3) 'b' (2) 'algos' (2) 'foo' (1) 'uninstalled_module' (1) 'hello' (1) '_hello' (1) '_house' (1) 'a' (1)
None (45)
AstroidImportError (43) TooManyLevelsError (1) AstroidSyntaxError (1)
1def _is_from_future_import(stmt: nodes.ImportFrom, name: str) -> bool | None:
2 """Check if the name is a future import from another module."""
3 try:
4 module = stmt.do_import_module(stmt.modname)
5 except astroid.AstroidBuildingException:
6 return None
7
8 for local_node in module.locals.get(name, []):
9 if isinstance(local_node, nodes.ImportFrom) and local_node.modname == FUTURE:
10 return True
11 return None
Path 3: 15 calls (0.03)
ImportFrom (15)
'request' (1) 'error' (1) 'urlparseq' (1) 'missing' (1) 'findiiter' (1) 'compiile' (1) 'anything' (1) 'lala' (1) 'THIS_does_not_EXIST' (1) 'doesnottex...
None (15)
1def _is_from_future_import(stmt: nodes.ImportFrom, name: str) -> bool | None:
2 """Check if the name is a future import from another module."""
3 try:
4 module = stmt.do_import_module(stmt.modname)
5 except astroid.AstroidBuildingException:
6 return None
7
8 for local_node in module.locals.get(name, []):
9 if isinstance(local_node, nodes.ImportFrom) and local_node.modname == FUTURE:
10 return True
11 return None