From 47947915460f593a44bcab7b8bdf55551b820cbb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2016 00:13:57 +0530 Subject: [PATCH] oops --- src/calibre/gui2/win_file_dialogs.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/gui2/win_file_dialogs.py b/src/calibre/gui2/win_file_dialogs.py index 1cb58fc903..bf9938b286 100644 --- a/src/calibre/gui2/win_file_dialogs.py +++ b/src/calibre/gui2/win_file_dialogs.py @@ -148,9 +148,7 @@ def run_file_dialog( raise Exception('File dialog failed: ' + h.stderrdata.decode('utf-8')) if not h.stdoutdata: return () - ans = tuple(filter(None, (os.path.abspath(x.decode('utf-8')) for x in h.stdoutdata.split(b'\0')))) - if len(ans) > 1: - ans = ans[:-1] # For some reason windows returns the initial folder as well, as the last item + ans = tuple((os.path.abspath(x.decode('utf-8')) for x in h.stdoutdata.split(b'\0') if x)) return ans if __name__ == '__main__':