diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index 6fbb787f6f5b578f5c62daa439343c744ba3fcd7..e70299c4291e90edca810cc57c082f235ed482e1 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."""