]> arthur.barton.de Git - bup.git/commitdiff
rewire a try/finally with a yield inside to be compatible with python 2.4
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 31 Jan 2010 00:23:53 +0000 (19:23 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 31 Jan 2010 01:31:01 +0000 (20:31 -0500)
Apparently you can't put a 'yield' inside a try/finally in older versions of
python.  lame.

git.py

diff --git a/git.py b/git.py
index 998bc3c257609650bf490f55161882324907691c..17edcca457902c0a8856370c8995b0069ac0e9c2 100644 (file)
--- a/git.py
+++ b/git.py
@@ -580,12 +580,9 @@ class CatPipe:
             yield type
             for blob in it:
                 yield blob
-        finally:
-            try:
-                while 1:
-                    it.next()
-            except StopIteration:
-                pass
+        except StopIteration:
+            while 1:
+                it.next()
         assert(self.p.stdout.readline() == '\n')
 
     def _slow_get(self, id):