Remove unnecessary if-branch in fuzzy_url.

The first branch already checks for `os.path.exists(path)`, so it doesn't make
sense for the second one to check that again (ANDed with some other condition).
This commit is contained in:
Florian Bruhin 2014-12-26 15:03:30 +01:00
parent 4ab5d2df28
commit dec6842370

View File

@ -141,13 +141,6 @@ def fuzzy_url(urlstr, cwd=None):
if os.path.exists(path):
log.url.debug("URL is a local file")
url = QUrl.fromLocalFile(path)
elif (not _has_explicit_scheme(QUrl(urlstr)) and
os.path.exists(path)):
# We do this here rather than in the first block because we first want
# to make sure it's not an URL like http://, because os.path.abspath
# would mangle that.
log.url.debug("URL is a relative local file")
url = QUrl.fromLocalFile(path)
elif is_url(stripped):
# probably an address
log.url.debug("URL is a fuzzy address")