Fix exception escape warning

W1661(exception-escape), RPCClient.forward]
Using an exception object that was bound by an except handler)

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Christian Heimes
2020-04-27 14:33:17 +02:00
committed by Rob Crittenden
parent 49f909c9d3
commit 24cc13db89
2 changed files with 4 additions and 4 deletions

View File

@@ -1170,11 +1170,11 @@ class RPCClient(Connectible):
try: try:
principal = getattr(context, 'principal', None) principal = getattr(context, 'principal', None)
delete_persistent_client_session_data(principal) delete_persistent_client_session_data(principal)
except Exception as e: except Exception as e2:
# This shouldn't happen if we have a session # This shouldn't happen if we have a session
# but it isn't fatal. # but it isn't fatal.
logger.debug("Error trying to remove persisent " logger.debug("Error trying to remove persisent "
"session data: %s", e) "session data: %s", e2)
# Create a new serverproxy with the non-session URI # Create a new serverproxy with the non-session URI
serverproxy = self.create_connection( serverproxy = self.create_connection(

View File

@@ -1567,9 +1567,9 @@ class LDAPClient:
str(base_dn), scope, filter, attrs_list, str(base_dn), scope, filter, attrs_list,
serverctrls=sctrls, timeout=time_limit, serverctrls=sctrls, timeout=time_limit,
sizelimit=size_limit) sizelimit=size_limit)
except ldap.LDAPError as e: except ldap.LDAPError as e2:
logger.warning( logger.warning(
"Error cancelling paged search: %s", e) "Error cancelling paged search: %s", e2)
cookie = '' cookie = ''
try: try: