summaryrefslogtreecommitdiff
path: root/buildscripts/buildlogger.py
diff options
context:
space:
mode:
authorDan Crosta <dcrosta@10gen.com>2012-04-02 14:48:07 -0400
committerDan Crosta <dcrosta@10gen.com>2012-04-02 14:48:07 -0400
commit8b1c9bd361bd002980266c5269e5eab4ba62a7f5 (patch)
tree9bb28f26ae7c787889a876c7c109fa91fcb5e22e /buildscripts/buildlogger.py
parent6e4aa245bbf233b6acc7b1ebf77ad59cc5d200d8 (diff)
downloadmongo-8b1c9bd361bd002980266c5269e5eab4ba62a7f5.tar.gz
access HTTPError headers safely
Diffstat (limited to 'buildscripts/buildlogger.py')
-rw-r--r--buildscripts/buildlogger.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/buildscripts/buildlogger.py b/buildscripts/buildlogger.py
index 10b423b65f0..bebd23af5c9 100644
--- a/buildscripts/buildlogger.py
+++ b/buildscripts/buildlogger.py
@@ -107,9 +107,10 @@ def traceback_to_stderr(func):
return func(*args, **kwargs)
except urllib2.HTTPError, err:
sys.stderr.write('error: HTTP code %d\n----\n' % err.code)
- for k, v in dict(err.info()).items():
- sys.stderr.write("%s: %s\n" % (k, v))
- sys.stderr.write('\n')
+ if hasattr(err, 'hdrs'):
+ for k, v in err.hdrs.items():
+ sys.stderr.write("%s: %s\n" % (k, v))
+ sys.stderr.write('\n')
sys.stderr.write(err.read())
sys.stderr.write('\n----\n')
sys.stderr.flush()