[meld/meld-1.6] Revert use of next() for Python 2.5 compatibility
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/meld-1.6] Revert use of next() for Python 2.5 compatibility
- Date: Mon, 30 Jul 2012 07:47:44 +0000 (UTC)
commit d81b14acfce0e052635863a7a9705405d4da9b5f
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Jul 31 03:23:45 2012 +1000
Revert use of next() for Python 2.5 compatibility
Patch from Gianni Trovisi.
meld/dirdiff.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 2f8fc97..74c0bcf 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -192,7 +192,10 @@ class CanonicalListing(object):
self.errors.append((pane, item, self.items[ci][pane]))
def get(self):
- first = lambda seq: next(s for s in seq if s)
+ def first_nonempty(seq):
+ for s in seq:
+ if s:
+ return s
filled = lambda seq: tuple([s or first(seq) for s in seq])
return sorted([filled(v) for v in self.items.itervalues()])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]