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

Change to TimeoutError #71

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

arrrobase
Copy link

sci = self.send('scientifica', timeout=0.2) (line 132) will lead to a TimeoutError, not RunetimeError. If want to try again need to catch TimeoutError.

sci = self.send('scientifica', timeout=0.2) (line 132) will lead to a TimeoutError, not RunetimeError. If want to try again need to catch TimeoutError.
@@ -130,7 +130,7 @@ def __init__(self, port=None, name=None, baudrate=None, ctrl_version=2):
SerialDevice.__init__(self, port=self.port, baudrate=baudrate)
try:
sci = self.send('scientifica', timeout=0.2)
except RuntimeError:
except TimeoutError:
Copy link
Contributor

Choose a reason for hiding this comment

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

In some circumstances we might get a RuntimeError as well, so it should be

except (RuntimeError, TimeoutError):

@campagnola campagnola deleted the branch acq4:develop October 8, 2021 22:42
@campagnola campagnola closed this Oct 8, 2021
@campagnola campagnola reopened this Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants