Python 2.6 does not have reason in urllib2.HTTPError
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 04 Dec 2014 16:14:47 -0800
changeset 5239 c89d4f6c104b7069679a48689447f46c4853e293
parent 5238 566480979a5ed640f79859f5a067088499622a38
child 5240 e6544d496365e4534d516aa0db524ce3d48c05bc
push id3
push usersledru@mozilla.com
push dateFri, 05 Dec 2014 00:16:43 +0000
Python 2.6 does not have reason in urllib2.HTTPError
buildbot-helpers/release_sanity.py
--- a/buildbot-helpers/release_sanity.py
+++ b/buildbot-helpers/release_sanity.py
@@ -129,17 +129,21 @@ def verify_l10n_changesets(hgHost, l10n_
             'revision': revision,
         }
         locale_url = make_hg_url(hgHost, localePath, protocol='https')
         log.info("Checking for existence l10n changeset %s %s in repo %s ..."
                  % (locale, revision, locale_url))
         try:
             urllib2.urlopen(locale_url)
         except urllib2.HTTPError, e:
-            log.error("error checking l10n changeset %s: %d %s" % (locale_url, e.code, e.reason))
+            reason = ""
+            if hasattr(e, 'reason'):
+                # Python 2.6 does not have reason
+                reason = e.reason
+            log.error("error checking l10n changeset %s: %d %s" % (locale_url, e.code, reason))
             success = False
             error_tally.add('verify_l10n')
     return success
 
 
 def verify_l10n_dashboard(l10n_changesets, l10n_dashboard_version=None):
     """Checks the l10n-changesets against the l10n dashboard"""
     success = True