diff --git a/scripts/examples/python/XenAPI/XenAPI.py b/scripts/examples/python/XenAPI/XenAPI.py index 9bb4431bb14..6c97f499b5d 100644 --- a/scripts/examples/python/XenAPI/XenAPI.py +++ b/scripts/examples/python/XenAPI/XenAPI.py @@ -216,14 +216,15 @@ def _login(self, method, params): # pytype false positive: there is a socket.errno in both py2 and py3 if e.errno == socket.errno.ETIMEDOUT: # pytype: disable=module-attr raise xmlrpclib.Fault(504, 'The connection timed out') - else: - raise e + raise e def _logout(self): try: if self.last_login_method.startswith("slave_local"): # Proxied function, pytype can't see it - return _parse_result(self.session.local_logout(self._session)) # pytype: disable=attribute-error + # pytype: disable=attribute-error + return _parse_result(self.session.local_logout(self._session)) + # pytype: enable=attribute-error else: return _parse_result(self.session.logout(self._session)) finally: