summaryrefslogtreecommitdiff
path: root/Lib/modulefinder.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-04-12 18:17:06 +0200
committerVictor Stinner <victor.stinner@gmail.com>2016-04-12 18:17:06 +0200
commit69b31404d93d6518315bb50e8f9f2e6bdddd0cdc (patch)
tree352b838029f8d2f92cb55d660547edbbf3b9cf16 /Lib/modulefinder.py
parent061ba066f40b6adb7f31124e32fb6a6ebe2c518b (diff)
downloadcpython-69b31404d93d6518315bb50e8f9f2e6bdddd0cdc.tar.gz
Issue #26647: Cleanup modulefinder
Use directly dis.opmap[name] rather than dis.opname.index(name). Patch written by Demur Rumed.
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r--Lib/modulefinder.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index 4a2f1b5491..d8d645c77b 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -14,11 +14,11 @@ with warnings.catch_warnings():
import imp
# XXX Clean up once str8's cstor matches bytes.
-LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')])
-IMPORT_NAME = bytes([dis.opname.index('IMPORT_NAME')])
-STORE_NAME = bytes([dis.opname.index('STORE_NAME')])
-STORE_GLOBAL = bytes([dis.opname.index('STORE_GLOBAL')])
-STORE_OPS = [STORE_NAME, STORE_GLOBAL]
+LOAD_CONST = bytes([dis.opmap['LOAD_CONST']])
+IMPORT_NAME = bytes([dis.opmap['IMPORT_NAME']])
+STORE_NAME = bytes([dis.opmap['STORE_NAME']])
+STORE_GLOBAL = bytes([dis.opmap['STORE_GLOBAL']])
+STORE_OPS = STORE_NAME, STORE_GLOBAL
HAVE_ARGUMENT = bytes([dis.HAVE_ARGUMENT])
# Modulefinder does a good job at simulating Python's, but it can not