Skip to content

Commit 4605f8c

Browse files
committed
FIX: matplotlib version did not show in about dialog (closes #279)
1 parent 8e836d3 commit 4605f8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

larray_editor/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ def get_module_version(module_name):
6262
from qtpy import API_NAME, PYQT_VERSION # API_NAME --> PyQt5 or PyQt4
6363
qt_version = module.__version__
6464
return f'{qt_version}, {API_NAME} {PYQT_VERSION}'
65-
elif '__version__' in dir(module):
65+
# at least for matplotlib, we cannot test this using '__version__' in dir(module)
66+
elif hasattr(module, '__version__'):
6667
return module.__version__
67-
elif '__VERSION__' in dir(module):
68+
elif hasattr(module, '__VERSION__'):
6869
return module.__VERSION__
6970
else:
7071
return 'N/A'

0 commit comments

Comments
 (0)