From 82ac85d743a19244968b044c956b1c6fdb3b8678 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Wed, 18 Feb 2015 15:30:24 +0100 Subject: [PATCH] bugfix: return value of QFileDialog method calls must be handled carefully --- QtPyLoT.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 1c23fa7a..35e036a2 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -298,7 +298,10 @@ class MainWindow(QMainWindow): "Select waveform " "files:", dir=searchPath) - self.fnames = fnames + if isinstance(fnames[0], list): + self.fnames = fnames[0] + else: + self.fnames = fnames else: raise DatastructureError('not specified') @@ -319,7 +322,7 @@ class MainWindow(QMainWindow): except FormatError: return False except AttributeError: - fname, = QFileDialog.getSaveFileName(self, 'Save event') + fname = QFileDialog.getSaveFileName(self, 'Save event') self.data.exportEvent(fname, exform) return True