Skip to content

Commit

Permalink
ldap.schema.tokenizer: removed 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 1e54be2 commit 92d40af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/ldap/schema/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ def extract_tokens(l,known_tokens):
"""
assert l[0].strip()=="(" and l[-1].strip()==")",ValueError(l)
result = {}
result_has_key = result.has_key
result.update(known_tokens)
i = 0
l_len = len(l)
while i<l_len:
if result_has_key(l[i]):
if l[i] in result:
token = l[i]
i += 1 # Consume token
if i<l_len:
if result_has_key(l[i]):
if l[i] in result:
# non-valued
result[token] = (())
elif l[i]=="(":
Expand Down

0 comments on commit 92d40af

Please sign in to comment.