Commits

Anonymous committed 29a4496

extract: fixed finding variable reads in functions

  • Participants
  • Parent commits 465aec3

Comments (0)

Files changed (1)

rope/refactor/extract.py

     def _FunctionDef(self, node):
         self.written.add(node.name)
         visitor = _VariableReadsAndWritesFinder()
-        ast.walk(node.code, visitor)
+        for child in ast.get_child_nodes(node):
+            ast.walk(child, visitor)
         self.read.update(visitor.read - visitor.written)
 
     def _Class(self, node):