From 8e48815f54111d02d686c921aede0ef2590e8b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 7 Jul 2010 16:29:59 +0200 Subject: [PATCH] Nothing guarantees that HTTPError has read method. --- osc/babysitter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osc/babysitter.py b/osc/babysitter.py index ab3b2d62..9d860449 100644 --- a/osc/babysitter.py +++ b/osc/babysitter.py @@ -104,7 +104,11 @@ def run(prg): if hasattr(e, 'osc_msg'): print >>sys.stderr, e.osc_msg - body = e.read() + try: + body = e.read() + except AttributeError: + body = '' + if getattr(prg.options, 'debug', None) or \ getattr(prg.conf, 'config', {}).get('debug', None): print >>sys.stderr, e.hdrs