summaryrefslogtreecommitdiff
path: root/Lib/compiler/pyassem.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/compiler/pyassem.py')
-rw-r--r--Lib/compiler/pyassem.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py
index 341127364b..dcc8bc08fa 100644
--- a/Lib/compiler/pyassem.py
+++ b/Lib/compiler/pyassem.py
@@ -253,8 +253,14 @@ class PyFlowGraph(FlowGraph):
def _lookupName(self, name, list):
"""Return index of name in list, appending if necessary"""
- if name in list:
- i = list.index(name)
+ found = None
+ t = type(name)
+ for i in range(len(list)):
+ # must do a comparison on type first to prevent UnicodeErrors
+ if t == type(list[i]) and list[i] == name:
+ found = 1
+ break
+ if found:
# this is cheap, but incorrect in some cases, e.g 2 vs. 2L
if type(name) == type(list[i]):
return i