From 5dac7008c7bc089d550ce73e64146f0620979849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Lehfeld?= <54720674+rlehfeld@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:37:02 +0200 Subject: [PATCH] enhance disconnect fix --- RPyCRobotRemote/RPyCRobotRemoteClient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RPyCRobotRemote/RPyCRobotRemoteClient.py b/RPyCRobotRemote/RPyCRobotRemoteClient.py index 2472851..5ca4c6f 100644 --- a/RPyCRobotRemote/RPyCRobotRemoteClient.py +++ b/RPyCRobotRemote/RPyCRobotRemoteClient.py @@ -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 @@ -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: @@ -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):