]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- python 2.4 compat
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 21 May 2012 19:02:20 +0000 (19:02 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    PLD_Builder/rpm_builder.py -> 1.132

PLD_Builder/rpm_builder.py

index 1ee86fbc91400536c64876953345d085381a168f..e42c085fee48f830bf81c25cee82d547a39753ba 100644 (file)
@@ -64,10 +64,16 @@ def check_skip_build(r, b):
             f = urllib2.urlopen(req)
             good = True
         except urllib2.HTTPError, error:
-                return False
+            return False
         except urllib2.URLError, error:
             # see errno.h
-            if error.errno in [-3, 60, 61, 110, 111]:
+            try:
+                errno = error.errno
+            except AttributeError:
+                # python 2.4
+                errno = error.reason[0]
+
+            if errno in [-3, 60, 61, 110, 111]:
                 b.log_line("unable to connect... trying again")
                 continue
             else:
@@ -101,7 +107,13 @@ def fetch_src(r, b):
                 return False
         except urllib2.URLError, error:
             # see errno.h
-            if error.errno in [-3, 60, 61, 110, 111]:
+            try:
+                errno = error.errno
+            except AttributeError:
+                # python 2.4
+                errno = error.reason[0]
+
+            if errno in [-3, 60, 61, 110, 111]:
                 b.log_line("unable to connect to %s... trying again" % (src_url))
                 continue
             else:
This page took 0.153747 seconds and 4 git commands to generate.