From dec6842370ab317d8fbaeba6fec3f968f2f3294f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 26 Dec 2014 15:03:30 +0100 Subject: [PATCH] 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). --- qutebrowser/utils/urlutils.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index d738b6410..f0d5d437a 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -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")