Only prepend http:// to non-empty URLs.

This commit is contained in:
Bastian Kleineidam 2010-12-03 20:46:57 +01:00
parent 6d38a4e296
commit 4a9b05dbfd

View file

@ -239,7 +239,7 @@ Version 2 or later.</p>
url = u"http://%s" % url
elif url.startswith(u"ftp."):
url = u"ftp://%s" % url
elif u":" not in url:
elif url and u":" not in url:
# Look for local filename, else assume it's an HTTP URL.
if not os.path.isfile(url):
url = u"http://%s" % url