-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Properly check if connection can be established for importing interactive visualizations #892
Properly check if connection can be established for importing interactive visualizations #892
Conversation
Please, remember to file an issue and link the PR with it by adding "Fix <issue_number>". |
Can you remember to remove |
Also, perhaps we could take the chance to reevaluate the need for the
line from the main Our top-level |
Actually the bug fixed here was caught becuase of the top level visualization imports. They were not the cause. Anytime someone loaded the visualization module, the same issue would pop up. |
The function added here could also be useful for having a more graceful error message if the register function cannot connect to the host urls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, I was going to fix it by just catching requests.exceptions.RequestException but switching to just checking if we can open a socket or not works fine too.
…tive visualizations (Qiskit#892) * check if has connection * Removed requests and updated changelog
Fix #895
Summary
As pointed out by @chriseclectic , loading qiskit with no internet connection results in a
ConnectionError
because the interactive visualizations max out the number of attempts to look for the needed host url. Here we replace the previous check with on that gracefully exits if no connection can be established.Details and comments