diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 44418864f..fd1e12990 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -822,7 +822,8 @@ class CommandDispatcher: text.replace('\n', '\\n'))) text_urls = [u for u in text.split('\n') if u.strip()] if len(text_urls) > 1 and not urlutils.is_url(text_urls[0]) \ - and urlutils.get_path_if_valid(text_urls[0], check_exists = True) is None: + and urlutils.get_path_if_valid(text_urls[0], + check_exists=True) is not None: text_urls = [text] for i, text_url in enumerate(text_urls): if not window and i > 0: diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index 723f2c62f..3f79cb87c 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -171,8 +171,8 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True): A target QUrl to a search page or the original URL. """ urlstr = urlstr.strip() - path = get_path_if_valid(urlstr, cwd = cwd, relative = relative, - check_exists = True) + path = get_path_if_valid(urlstr, cwd=cwd, relative=relative, + check_exists=True) if path is not None: url = QUrl.fromLocalFile(path) @@ -336,7 +336,7 @@ def raise_cmdexc_if_invalid(url): if not url.isValid(): raise cmdexc.CommandError(get_errstring(url)) -def get_path_if_valid(pathstr, cwd = None, relative=False, check_exists = False): +def get_path_if_valid(pathstr, cwd=None, relative=False, check_exists=False): """Check if path is a valid path Args: