Skip to content

Commit

Permalink
ldapurl: eliminated use of .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 4904fbf commit 00c2b9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/ldapurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ def __repr__(self):
)

def __getattr__(self,name):
if self.attr2extype.has_key(name):
if name in self.attr2extype:
extype = self.attr2extype[name]
if self.extensions and \
self.extensions.has_key(extype) and \
extype in self.extensions and \
not self.extensions[extype].exvalue is None:
result = unquote(self.extensions[extype].exvalue)
else:
Expand All @@ -413,7 +413,7 @@ def __getattr__(self,name):
return result # __getattr__()

def __setattr__(self,name,value):
if self.attr2extype.has_key(name):
if name in self.attr2extype:
extype = self.attr2extype[name]
if value is None:
# A value of None means that extension is deleted
Expand All @@ -427,7 +427,7 @@ def __setattr__(self,name,value):
self.__dict__[name] = value

def __delattr__(self,name):
if self.attr2extype.has_key(name):
if name in self.attr2extype:
extype = self.attr2extype[name]
if self.extensions:
try:
Expand Down

0 comments on commit 00c2b9b

Please sign in to comment.