From dd6a0467ed9c151a819626cf811553e4a8880e84 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 20 Jul 2007 22:10:59 +0000 Subject: Fix parabuild breakage. Why the F is urllib opening an ftp connection to localhost? Not reviewed. --- scripts/template_verifier.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index 6fbb787f6f..e70299c429 100755 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -94,8 +94,13 @@ def compare(base, current, mode): return False, compat def fetch(url): - # *FIX: this doesn't throw an exception for a 404, and oddly enough the sl.com 404 page actually gets parsed successfully - return ''.join(urllib.urlopen(url).readlines()) + if url.startswith('file://'): + # just open the file directly because urllib is dumb about these things + file_name = url[len('file://'):] + return open(file_name).read() + else: + # *FIX: this doesn't throw an exception for a 404, and oddly enough the sl.com 404 page actually gets parsed successfully + return ''.join(urllib.urlopen(url).readlines()) def cache_master(master_url): """Using the url for the master, updates the local cache, and returns an url to the local cache.""" -- cgit v1.2.3