From b80320d566513664c8b299186a6f799210783740 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Thu, 14 Aug 2003 00:15:30 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2092 --- test/test_sanity.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test_sanity.py b/test/test_sanity.py index 89eef0fb62..8ab606d5a2 100755 --- a/test/test_sanity.py +++ b/test/test_sanity.py @@ -10,14 +10,20 @@ import urllib, random def read_url(url, quiet=False): '''return 1 line from url''' verbose_echo(2, " reading url: "+url) + err = '' try: return urllib.URLopener().open(url).readline().strip() except IOError, e: - if not quiet: - error("couldn't access url: %s %s" % (url, e)) - else: - verbose_echo(2, "couldn't access url: %s %s" % (url, e)) - return '' + err = e + except AttributeError: + # Python urllib is buggy if connection is closed (by our proxy + # intentionally) right after opened + pass + if not quiet: + error("couldn't access url: %s %s" % (url, err)) + else: + verbose_echo(2, "couldn't access url: %s %s" % (url, err)) + return '' if __name__ == '__main__': test_msg("framework sanity");