Rev 5890: (jameinel) Close file objects a bit earlier in _seek_and_read. Helps PyPy's in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed May 18 10:55:14 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5890 [merge]
revision-id: pqm at pqm.ubuntu.com-20110518105512-8rhaqw4g6a8pnjuo
parent: pqm at pqm.ubuntu.com-20110518100231-sow1yki9r9mghg61
parent: gzlist at googlemail.com-20110518091314-ottoskmtfpnych7v
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-05-18 10:55:12 +0000
message:
  (jameinel) Close file objects a bit earlier in _seek_and_read. Helps PyPy's
   lazy collector. (Martin [gz])
modified:
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2011-04-27 08:05:26 +0000
+++ b/bzrlib/transport/__init__.py	2011-05-18 09:13:14 +0000
@@ -712,12 +712,11 @@
                     try:
                         cur_offset_and_size = offset_stack.next()
                     except StopIteration:
+                        fp.close()
                         cur_offset_and_size = None
                     yield this_offset, this_data
-        except:
+        finally:
             fp.close()
-            raise
-        fp.close()
 
     def _sort_expand_and_combine(self, offsets, upper_limit):
         """Helper for readv.




More information about the bazaar-commits mailing list