Move isabs check to top in fuzzy_url.

This commit is contained in:
Florian Bruhin 2015-07-06 17:10:24 +02:00
parent 47d5262cd9
commit e3fcc0e091

View File

@ -153,15 +153,15 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True):
A target QUrl to a search page or the original URL.
"""
expanded = os.path.expanduser(urlstr)
if relative and cwd:
if os.path.isabs(expanded):
path = expanded
elif relative and cwd:
path = os.path.join(cwd, expanded)
elif relative:
try:
path = os.path.abspath(expanded)
except OSError:
path = None
elif os.path.isabs(expanded):
path = expanded
else:
path = None