Skip to content

Commit

Permalink
Python Bindings: Fix uncaught exception in 'deadlinesocket'
Browse files Browse the repository at this point in the history
Python Bindings throws an error if the socket does not provide data:
Traceback (most recent call last):
....
File "/usr/lib/python3/dist-packages/MythTV/utility/other.py", line 374, in dlexpect
raise MythError(MythError.CLOSEDSOCKET)
AttributeError: type object 'MythError' has no attribute 'CLOSEDSOCKET'

Solution:
Align the error code to the methods provided by MythError.SOCKET.

Fixes #423
  • Loading branch information
rcrdnalor committed Dec 15, 2021
1 parent e57584b commit 1e6246d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/utility/other.py
Expand Up @@ -371,7 +371,7 @@ def dlexpect(self, pattern, flags=0, deadline=None):
raise MythError(MythError.SOCKET, e.args)
if buff.tell() == p:
# no data read from a 'ready' socket, connection terminated
raise MythError(MythError.CLOSEDSOCKET)
raise MythError(MythError.SOCKET, (54, 'Connection reset by peer'))

if timeout == 0:
break
Expand Down

0 comments on commit 1e6246d

Please sign in to comment.