diff options
author | pierre-yves david <pierre-yves.david@insa-lyon.fr> | 2008-10-19 23:25:39 +0200 |
---|---|---|
committer | pierre-yves david <pierre-yves.david@insa-lyon.fr> | 2008-10-19 23:25:39 +0200 |
commit | fe08edd82ae7594b7edc9ab3d084643d812402f3 (patch) | |
tree | 8edf0df5416048ffd7d655f4ae2cd37713a07705 /bind.py | |
parent | d79d1b8ceebe87d76c4226167b06f3d4dee90656 (diff) | |
download | logilab-common-fe08edd82ae7594b7edc9ab3d084643d812402f3.tar.gz |
replace all has_key call with "element in dict" statement (3.x compat)
Diffstat (limited to 'bind.py')
-rw-r--r-- | bind.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -48,7 +48,7 @@ def bind_code(co, globals): oparg = None if op == LOAD_GLOBAL: name = co.co_names[oparg] - if globals.has_key(name): + if name in globals: k = assigned.get(name, None) if k == None: k = len(consts) @@ -139,7 +139,7 @@ def analyze_code(co, globals, consts_dict, consts_list): if op == LOAD_GLOBAL: name = co.co_names[oparg] - if globals.has_key(name): + if name in globals: k = consts_dict.get(name, None) if k == None: k = len(consts_list) @@ -147,7 +147,7 @@ def analyze_code(co, globals, consts_dict, consts_list): consts_list.append(globals[name]) if op == STORE_GLOBAL: name = co.co_names[oparg] - if globals.has_key(name): + if name in globals: modified_globals.append(name) return modified_globals |