At file:///net/bigmamac/Volumes/home/vila/src/bzr/experimental/more-ftp/

------------------------------------------------------------
revno: 3514
revision-id: [email protected]
parent: [email protected]
committer: Vincent Ladeuil <[email protected]>
branch nick: binary-mode
timestamp: Fri 2009-02-27 09:44:36 +0100
message:
  Fix python-2.4 compatibility.
  
  * bzrlib/transport/ftp/__init__.py:
  (FtpTransport.list_dir): try/except/finally features are reduced
  under python-2.4.
=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py  2009-02-26 19:30:06 +0000
+++ b/bzrlib/transport/ftp/__init__.py  2009-02-27 08:44:36 +0000
@@ -519,19 +519,21 @@
         mutter("FTP nlst: %s", basepath)
         f = self._get_FTP()
         try:
-            paths = f.nlst(basepath)
-        except ftplib.error_perm, e:
-            self._translate_perm_error(e, relpath, extra='error with list_dir')
-        except ftplib.error_temp, e:
-            # xs4all's ftp server raises a 450 temp error when listing an empty
-            # directory. Check for that and just return an empty list in that
-            # case. See bug #215522
-            if str(e).lower().startswith('450 no files found'):
-                mutter('FTP Server returned "%s" for nlst.'
-                       ' Assuming it means empty directory',
-                       str(e))
-                return []
-            raise
+            try:
+                paths = f.nlst(basepath)
+            except ftplib.error_perm, e:
+                self._translate_perm_error(e, relpath,
+                                           extra='error with list_dir')
+            except ftplib.error_temp, e:
+                # xs4all's ftp server raises a 450 temp error when listing an
+                # empty directory. Check for that and just return an empty list
+                # in that case. See bug #215522
+                if str(e).lower().startswith('450 no files found'):
+                    mutter('FTP Server returned "%s" for nlst.'
+                           ' Assuming it means empty directory',
+                           str(e))
+                    return []
+                raise
         finally:
             # Restore binary mode as nlst switch to ascii mode to retrieve file
             # list

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to