From 4a360ba185341f6404e7f2751f01ba2a3102b3be Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 28 Oct 2016 07:17:57 +0200 Subject: [PATCH] Simplify _set_fileview_root --- qutebrowser/mainwindow/prompt.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index d0d807d26..ccf2c3d4d 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -538,16 +538,9 @@ class FilenamePrompt(_BasePrompt): path.rstrip(separators) try: - if os.path.isdir(path): - path = path - elif os.path.isdir(os.path.basename(path)): - path = os.path.basename(path) - else: - path = None + if not os.path.isdir(path): + return except OSError: - path = None - - if path is None: return root = self._file_model.setRootPath(path)