mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Issue #26647: Cleanup modulefinder
Use directly dis.opmap[name] rather than dis.opname.index(name). Patch written by Demur Rumed.
This commit is contained in:
parent
7b228231c7
commit
7e50978a4e
1 changed files with 5 additions and 5 deletions
|
|
@ -14,11 +14,11 @@
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue