Skip to content

Commit

Permalink
Fix exception escape warning
Browse files Browse the repository at this point in the history
W1661(exception-escape), RPCClient.forward]
Using an exception object that was bound by an except handler)

Signed-off-by: Christian Heimes <[email protected]>
Reviewed-By: Alexander Bokovoy <[email protected]>
Reviewed-By: Rob Crittenden <[email protected]>
  • Loading branch information
tiran authored and rcritten committed Apr 27, 2020
1 parent 49f909c commit 24cc13d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ipalib/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,11 +1170,11 @@ def forward(self, name, *args, **kw):
try:
principal = getattr(context, 'principal', None)
delete_persistent_client_session_data(principal)
except Exception as e:
except Exception as e2:
# This shouldn't happen if we have a session
# but it isn't fatal.
logger.debug("Error trying to remove persisent "
"session data: %s", e)
"session data: %s", e2)

# Create a new serverproxy with the non-session URI
serverproxy = self.create_connection(
Expand Down
4 changes: 2 additions & 2 deletions ipapython/ipaldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1567,9 +1567,9 @@ def find_entries(
str(base_dn), scope, filter, attrs_list,
serverctrls=sctrls, timeout=time_limit,
sizelimit=size_limit)
except ldap.LDAPError as e:
except ldap.LDAPError as e2:
logger.warning(
"Error cancelling paged search: %s", e)
"Error cancelling paged search: %s", e2)
cookie = ''

try:
Expand Down

0 comments on commit 24cc13d

Please sign in to comment.