diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-04-12 16:17:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-04-12 16:17:06 (GMT) |
commit | 7e50978a4e36cd4ab4b363ee0c77abefc13e2c23 (patch) | |
tree | 7750827b2139e8f50a11b734c4d0c1e16925df1d /Lib/modulefinder.py | |
parent | 7b228231c78f49986928cd587cbf85197a3b3987 (diff) | |
download | cpython-7e50978a4e36cd4ab4b363ee0c77abefc13e2c23.zip cpython-7e50978a4e36cd4ab4b363ee0c77abefc13e2c23.tar.gz cpython-7e50978a4e36cd4ab4b363ee0c77abefc13e2c23.tar.bz2 |
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.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 4a2f1b5..d8d645c 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 |