From: Avery Pennarun Date: Sun, 31 Jan 2010 00:23:53 +0000 (-0500) Subject: rewire a try/finally with a yield inside to be compatible with python 2.4 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7e6453a36e29fe21da6b0e5d0117216348693c61;p=packages%2Fb%2Fbup.git rewire a try/finally with a yield inside to be compatible with python 2.4 Apparently you can't put a 'yield' inside a try/finally in older versions of python. lame. --- diff --git a/git.py b/git.py index 998bc3c..17edcca 100644 --- 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):