Skip to content

Commit

Permalink
enhance disconnect fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rlehfeld committed Apr 22, 2024
1 parent 8908338 commit 5dac700
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RPyCRobotRemote/RPyCRobotRemoteClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(self,

# automatic redirect stdout + stderr from remote during
# during handling of sync_request
self._connected = True
self._client._redirected = False
self._client.sync_request = redirect_output(self._client.sync_request)
# pylint: enable=R0913
Expand All @@ -123,7 +124,8 @@ def __doc__(self):
return getattr(self._client.root.library, '__doc__')

def __getattr__(self, name: str):
if name[0:1] != '_':
if (name[0:1] != '_' and
(not name.startswith('ROBOT_LIBRARY_') or self._connected)):
try:
obj = getattr(self._client.root.library, name)
except AttributeError:
Expand All @@ -139,6 +141,7 @@ def stop_remote_server(self):
"""Stop remote server."""
self._client.root.stop_remote_server()
self._client.close()
self._connected = False

@not_keyword
def get_keyword_names(self):
Expand Down

0 comments on commit 5dac700

Please sign in to comment.