cpython: 423e2a96189e (original) (raw)

Mercurial > cpython

changeset 100941:423e2a96189e

Issue #26647: Cleanup modulefinder Use directly dis.opmap[name] rather than dis.opname.index(name). Patch written by Demur Rumed. [#26647]

Victor Stinner victor.stinner@gmail.com
date Tue, 12 Apr 2016 18:17:06 +0200
parents 7bf08a11d4c9
children 8ac6cc5a0c01
files Lib/modulefinder.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-)[+] [-] Lib/modulefinder.py 10

line wrap: on

line diff

--- 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