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

fix: anel.py declare result in front of exception #427

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

gylstorffq
Copy link
Contributor

result is unbound if _receive times out with the follow exeception:

mtda-mcom mtda-service[1400]: self._switch(False)
mtda-mcom mtda-service[1400]: File "/usr/lib/python3.11/dist-packages/mtda/power/anel.py", line 88, in _switch
mtda-mcom mtda-service[1400]: if result == "0":
mtda-mcom mtda-service[1400]: ^^^^^^
mtda-mcom mtda-service[1400]: UnboundLocalError: cannot access local variable 'result' where it is not associated with a value

result is unbound if _receive times out with the follow exeception:

mtda-mcom mtda-service[1400]:     self._switch(False)
mtda-mcom mtda-service[1400]:   File "/usr/lib/python3.11/dist-packages/mtda/power/anel.py", line 88, in _switch
mtda-mcom mtda-service[1400]:     if result == "0":
mtda-mcom mtda-service[1400]:        ^^^^^^
mtda-mcom mtda-service[1400]: UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
@github-actions github-actions bot requested a review from chombourger December 18, 2024 14:44
@chombourger chombourger merged commit 9e254cb into siemens:master Dec 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants