[mirrorbrain-commits] r8245 - in /trunk/mb/mb: crawlers/ftp.py testmirror.py util.py

From: <poeml_at_mirrorbrain.org>
Date: Sat, 31 Dec 2011 16:41:26 -0000
Author: poeml
Date: Sat Dec 31 17:41:24 2011
New Revision: 8245

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8245&view=rev
Log:
A compatibility issue in Python has been fixed, by updating the way how
exceptions are raised. A string is not a valid argument, instead an 'Exception'
must be raised. Thanks Christian Lohmaier for bringing this up.

Modified:
    trunk/mb/mb/crawlers/ftp.py
    trunk/mb/mb/testmirror.py
    trunk/mb/mb/util.py

Modified: trunk/mb/mb/crawlers/ftp.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/crawlers/ftp.py?rev=8245&r1=8244&r2=8245&view=diff
==============================================================================
--- trunk/mb/mb/crawlers/ftp.py (original)
+++ trunk/mb/mb/crawlers/ftp.py Sat Dec 31 17:41:24 2011
_at_@ -29,7 +29,7 @@
         name = parts[7]
         size = parts[3]
     else:
-        raise 'haeh? could not parse line from FTP listing'
+        raise Exception('haeh? could not parse line from FTP listing')
     return Afile(name, size)
 
 

Modified: trunk/mb/mb/testmirror.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/testmirror.py?rev=8245&r1=8244&r2=8245&view=diff
==============================================================================
--- trunk/mb/mb/testmirror.py (original)
+++ trunk/mb/mb/testmirror.py Sat Dec 31 17:41:24 2011
_at_@ -128,7 +128,7 @@
         return S
 
     else:
-        raise 'unknown URL type: %r' % S.probebaseurl
+        raise Exception('unknown URL type: %r' % S.probebaseurl)
 
 
 
_at_@ -163,7 +163,7 @@
                         for i in mirrors 
                         for url in get_all_urls(i) ]
     else:
-        raise 'unknown url_type value: %r' % url_type
+        raise Exception('unknown url_type value: %r' % url_type)
 
 
 def probe_report(m):

Modified: trunk/mb/mb/util.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/util.py?rev=8245&r1=8244&r2=8245&view=diff
==============================================================================
--- trunk/mb/mb/util.py (original)
+++ trunk/mb/mb/util.py Sat Dec 31 17:41:24 2011
_at_@ -49,7 +49,7 @@
                 or ('://' not in self.probebaseurl and '::' in self.probebaseurl):
             self.scheme = 'rsync'
         else:
-            raise 'unknown url type: %s' % self.probebaseurl
+            raise Exception('unknown url type: %s' % self.probebaseurl)
 
         self.probeurl = self.probebaseurl.rstrip('/') + '/' + self.filename.lstrip('/')
 




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sat Dec 31 2011 - 16:41:30 GMT

This archive was generated by hypermail 2.3.0 : Sat Dec 31 2011 - 16:47:06 GMT