"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pylint/checkers/refactoring/refactoring_checker.py" between
pylint-2.9.4.tar.gz and pylint-2.9.5.tar.gz

About: pylint analyzes Python source code looking for bugs and signs of poor quality.

refactoring_checker.py  (pylint-2.9.4):refactoring_checker.py  (pylint-2.9.5)
skipping to change at line 1403 skipping to change at line 1403
values = value.elts values = value.elts
else: else:
assignees = [node.targets[0]] assignees = [node.targets[0]]
values = [node.value] values = [node.value]
if Uninferable in (assignees, values): if Uninferable in (assignees, values):
return return
for assignee, value in zip(assignees, values): for assignee, value in zip(assignees, values):
if not isinstance(value, astroid.Call): if not isinstance(value, astroid.Call):
continue continue
inferred = utils.safe_infer(value.func) inferred = utils.safe_infer(value.func)
if not inferred or inferred.qname() not in CALLS_RETURNING_CONTEXT_M if (
ANAGERS: not inferred
or inferred.qname() not in CALLS_RETURNING_CONTEXT_MANAGERS
or not isinstance(assignee, (astroid.AssignName, astroid.AssignA
ttr))
):
continue continue
stack = self._consider_using_with_stack.get_stack_for_frame(node.fra me()) stack = self._consider_using_with_stack.get_stack_for_frame(node.fra me())
varname = ( varname = (
assignee.name assignee.name
if isinstance(assignee, astroid.AssignName) if isinstance(assignee, astroid.AssignName)
else assignee.attrname else assignee.attrname
) )
if varname in stack: if varname in stack:
# variable was redefined before it was used in a ``with`` block # variable was redefined before it was used in a ``with`` block
self.add_message( self.add_message(
 End of changes. 1 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)