From: Diane Trout Date: Thu, 8 Oct 2009 00:39:32 +0000 (+0000) Subject: In some cases test_retrive_config will attempt to normalize None as a url X-Git-Tag: 0.3.2~3 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=17d8d802376e0f602a93b7a7119d4cf42b93afd6 In some cases test_retrive_config will attempt to normalize None as a url which doesn't work so well. So this patch just returns the None and lets the problem get sorted out elsewhere. --- diff --git a/htsworkflow/util/url.py b/htsworkflow/util/url.py index 1b62e58..4e49c2d 100644 --- a/htsworkflow/util/url.py +++ b/htsworkflow/util/url.py @@ -14,7 +14,12 @@ def normalize_url(url, scheme='http'): 'http://foo.com/a/b/c/d/e/f.html' >>> normalize_url("foo.com", "https") 'https://foo.com' + >>> normalize_url(None) """ + # not much to do with None except avoid an exception + if url is None: + return None + scheme_sep = '://' if url.find(scheme_sep) != -1: return url