summaryrefslogtreecommitdiff
path: root/bind.py
diff options
context:
space:
mode:
authorpierre-yves david <pierre-yves.david@insa-lyon.fr>2008-10-19 23:25:39 +0200
committerpierre-yves david <pierre-yves.david@insa-lyon.fr>2008-10-19 23:25:39 +0200
commitfe08edd82ae7594b7edc9ab3d084643d812402f3 (patch)
tree8edf0df5416048ffd7d655f4ae2cd37713a07705 /bind.py
parentd79d1b8ceebe87d76c4226167b06f3d4dee90656 (diff)
downloadlogilab-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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bind.py b/bind.py
index b5f99f8..275ab8b 100644
--- a/bind.py
+++ b/bind.py
@@ -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