Mercurial > bitten > bitten-test
changeset 647:6fe6fc8ee36c
0.6dev: Follow-up to [719]. Seems some http errors don't populate `headers` (at least apache digest auth challenge didn't).
author | osimons |
---|---|
date | Mon, 24 Aug 2009 13:19:27 +0000 |
parents | fe344dac8385 |
children | a04e46a0bce3 |
files | bitten/slave.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/bitten/slave.py +++ b/bitten/slave.py @@ -159,8 +159,9 @@ return resp except urllib2.HTTPError, e: if e.code >= 300: - if e.headers.getheader('Content-Type', '' - ).startswith('text/plain'): + if hasattr(e, 'headers') and \ + e.headers.getheader('Content-Type', '' + ).startswith('text/plain'): content = e.read() else: content = 'no message available'