summaryrefslogtreecommitdiff
path: root/silx/gui/qt/_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/qt/_utils.py')
-rw-r--r--silx/gui/qt/_utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/silx/gui/qt/_utils.py b/silx/gui/qt/_utils.py
index be55465..912f08c 100644
--- a/silx/gui/qt/_utils.py
+++ b/silx/gui/qt/_utils.py
@@ -36,8 +36,11 @@ from . import _qt as qt
def supportedImageFormats():
"""Return a set of string of file format extensions supported by the
Qt runtime."""
- if sys.version_info[0] < 3 or qt.BINDING in ('PySide', 'PySide2'):
+ if sys.version_info[0] < 3 or qt.BINDING == 'PySide':
convert = str
+ elif qt.BINDING == 'PySide2':
+ def convert(data):
+ return str(data.data(), 'ascii')
else:
convert = lambda data: str(data, 'ascii')
formats = qt.QImageReader.supportedImageFormats()