[cleanup] Minor fixes

This commit is contained in:
pukkandan
2022-05-18 09:04:30 +05:30
parent 80e8493ee7
commit 21633673c3
8 changed files with 26 additions and 18 deletions

View File

@@ -714,7 +714,9 @@ def sanitize_path(s, force=False):
def sanitize_url(url):
# Prepend protocol-less URLs with `http:` scheme in order to mitigate
# the number of unwanted failures due to missing protocol
if url.startswith('//'):
if url is None:
return
elif url.startswith('//'):
return 'http:%s' % url
# Fix some common typos seen so far
COMMON_TYPOS = (