[PATCH] using variable out of scope in diffutil.py ?



Here we should use the lambda variable instead of an outer scope
variable, I think...

-- 
Vincent Legoll
Index: diffutil.py
===================================================================
--- diffutil.py	(révision 1153)
+++ diffutil.py	(copie de travail)
@@ -106,7 +106,7 @@
     def _locate_chunk(self, whichdiffs, sequence, line):
         """Find the index of the chunk which contains line."""
         idx = 1 + 2*(sequence != 1)
-        line_in_chunk = lambda x: line < c[idx+1]
+        line_in_chunk = lambda x: line < x[idx+1]
         i = 0
         for c in self.diffs[whichdiffs]:
             if line_in_chunk(c):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]