Check for existance of local files, including directories.

This commit is contained in:
Bastian Kleineidam 2011-02-09 08:50:36 +01:00
parent 362c7a1d9d
commit a24ced8b9a

View file

@ -256,8 +256,8 @@ to improve %(appname)s even more!
elif url.startswith(u"ftp."):
url = u"ftp://%s" % 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):
# Look for local file, else assume it's an HTTP URL.
if not os.path.exists(url):
url = u"http://%s" % url
return url