Skip to content

Commit

Permalink
ldap.ldapobject: avoid using .has_key()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent 1514852 commit 3e0ef81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/ldap/ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def _ldap_call(self,func,*args,**kwargs):
return result

def __setattr__(self,name,value):
if self.CLASSATTR_OPTION_MAPPING.has_key(name):
if name in self.CLASSATTR_OPTION_MAPPING:
self.set_option(self.CLASSATTR_OPTION_MAPPING[name],value)
else:
self.__dict__[name] = value

def __getattr__(self,name):
if self.CLASSATTR_OPTION_MAPPING.has_key(name):
if name in self.CLASSATTR_OPTION_MAPPING:
return self.get_option(self.CLASSATTR_OPTION_MAPPING[name])
elif self.__dict__.has_key(name):
return self.__dict__[name]
Expand Down

0 comments on commit 3e0ef81

Please sign in to comment.