Skip to content

Commit 372bc87

Browse files
authored
Work around PyQt5 bug with argument types (#3777)
Qt's getOpenFileUrls() and related Url-based functions are supposed to take a QUrl for the 'directory' argument (starting path), but until PyQt5 5.13.1 the argument was mis-typed as str.
1 parent 537c044 commit 372bc87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/windows/main_window.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from copy import deepcopy
3838

3939
from PyQt5.QtCore import (
40-
Qt, pyqtSignal, QCoreApplication,
40+
Qt, pyqtSignal, QCoreApplication, PYQT_VERSION_STR,
4141
QTimer, QDateTime, QFileInfo, QUrl,
4242
)
4343
from PyQt5.QtGui import QIcon, QCursor, QKeySequence
@@ -762,7 +762,7 @@ def actionImportFiles_trigger(self, event):
762762
recommended_path = os.path.join(info.HOME_PATH)
763763

764764
# PyQt through 5.13.0 had the 'directory' argument mis-typed as str
765-
if get_app().pyqt_version < '5.13.1':
765+
if PYQT_VERSION_STR < '5.13.1':
766766
dir_type = "str"
767767
start_location = str(recommended_path)
768768
else:

0 commit comments

Comments
 (0)