[projects/pld-builder.new] Error can be string, so check that.

arekm arekm at pld-linux.org
Thu Jun 20 09:19:24 CEST 2013


commit 27f5cb5936bf76ffe2c859b143ed0d4be05cdfef
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Jun 20 09:19:21 2013 +0200

    Error can be string, so check that.

 PLD_Builder/rpm_builder.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py
index 9c08c88..555cb36 100644
--- a/PLD_Builder/rpm_builder.py
+++ b/PLD_Builder/rpm_builder.py
@@ -106,7 +106,9 @@ def fetch_src(r, b):
                 b.log_line(msg)
                 return False
         except urllib2.URLError, error:
-            errno = error.reason.errno
+            errno = 0
+            if isinstance(error.args[0], IOError):
+                errno = error.args[0].errno
 
             if errno in [-3, 60, 61, 110, 111]:
                 b.log_line("unable to connect to %s... trying again" % (src_url))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/27f5cb5936bf76ffe2c859b143ed0d4be05cdfef



More information about the pld-cvs-commit mailing list