FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Issue #26647: Cleanup modulefinder · python/cpython@7e50978 · GitHub

Repository navigation

Commit 7e50978

Browse files
committed
Issue #26647: Cleanup modulefinder
Use directly dis.opmap[name] rather than dis.opname.index(name). Patch written by Demur Rumed.
1 parent 7b22823 commit 7e50978

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎Lib/modulefinder.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
import imp
1515

1616
# XXX Clean up once str8's cstor matches bytes.
17-
LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')])
18-
IMPORT_NAME = bytes([dis.opname.index('IMPORT_NAME')])
19-
STORE_NAME = bytes([dis.opname.index('STORE_NAME')])
20-
STORE_GLOBAL = bytes([dis.opname.index('STORE_GLOBAL')])
21-
STORE_OPS = [STORE_NAME, STORE_GLOBAL]
17+
LOAD_CONST = bytes([dis.opmap['LOAD_CONST']])
18+
IMPORT_NAME = bytes([dis.opmap['IMPORT_NAME']])
19+
STORE_NAME = bytes([dis.opmap['STORE_NAME']])
20+
STORE_GLOBAL = bytes([dis.opmap['STORE_GLOBAL']])
21+
STORE_OPS = STORE_NAME, STORE_GLOBAL
2222
HAVE_ARGUMENT = bytes([dis.HAVE_ARGUMENT])
2323

2424
# Modulefinder does a good job at simulating Python's, but it can not

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL