Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyqtgraph < 0.10 fail to run from pyqtgraph import __version__ , us… #13

Merged
merged 2 commits into from
Jul 31, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/rqt_plot/data_plot/pyqtgraph_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
def parse_version(s):
return [int(x) for x in re.sub(r'(\.0+)*$', '', s).split('.')]

from pyqtgraph import __version__ as pyqtgraph_version
try:
from pyqtgraph import __version__ as pyqtgraph_version
except:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please catch a specific exception type here as well as add a comment when it is expected to be raised.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dirk-thomas sorry for late, updated to catch only "RuntimeError"

import pkg_resources
pyqtgraph_version = pkg_resources.get_distribution("pyqtgraph").version

if parse_version(pyqtgraph_version) < parse_version('0.10.0'):
raise ImportError('A newer PyQtGraph version is required (at least 0.10 for Qt 5)')

Expand Down