Rev 5262: (lifeless) Fix gio_transport to be python2.4 syntax compatible. (Robert in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu May 27 05:14:09 BST 2010


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

------------------------------------------------------------
revno: 5262 [merge]
revision-id: pqm at pqm.ubuntu.com-20100527041407-3awh3n2osfpsb5iy
parent: pqm at pqm.ubuntu.com-20100527022030-wz9f4rvm9rfk6r59
parent: robertc at robertcollins.net-20100527025239-tmnb6dbjcd8vrsvz
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-05-27 05:14:07 +0100
message:
  (lifeless) Fix gio_transport to be python2.4 syntax compatible. (Robert
   Collins)
modified:
  bzrlib/transport/gio_transport.py __init__.py-20100430125031-jb4f7q7mtyz55kz3-2
=== modified file 'bzrlib/transport/gio_transport.py'
--- a/bzrlib/transport/gio_transport.py	2010-05-25 09:15:35 +0000
+++ b/bzrlib/transport/gio_transport.py	2010-05-27 02:52:39 +0000
@@ -304,21 +304,22 @@
         f = None
         fout = None
         try:
-            f = self._get_GIO(tmppath)
-            fout = f.create()
-            closed = False
-            length = self._pump(fp, fout)
-            fout.close()
-            closed = True
-            self.stat(tmppath)
-            dest = self._get_GIO(relpath)
-            f.move(dest, flags=gio.FILE_COPY_OVERWRITE)
-            f = None
-            if mode is not None:
-                self._setmode(relpath, mode)
-            return length
-        except gio.Error, e:
-            self._translate_gio_error(e, relpath)
+            try:
+                f = self._get_GIO(tmppath)
+                fout = f.create()
+                closed = False
+                length = self._pump(fp, fout)
+                fout.close()
+                closed = True
+                self.stat(tmppath)
+                dest = self._get_GIO(relpath)
+                f.move(dest, flags=gio.FILE_COPY_OVERWRITE)
+                f = None
+                if mode is not None:
+                    self._setmode(relpath, mode)
+                return length
+            except gio.Error, e:
+                self._translate_gio_error(e, relpath)
         finally:
             if not closed and fout is not None:
                 fout.close()




More information about the bazaar-commits mailing list