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. A target QUrl to a search page or the original URL.
""" """
expanded = os.path.expanduser(urlstr) 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) path = os.path.join(cwd, expanded)
elif relative: elif relative:
try: try:
path = os.path.abspath(expanded) path = os.path.abspath(expanded)
except OSError: except OSError:
path = None path = None
elif os.path.isabs(expanded):
path = expanded
else: else:
path = None path = None