Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit 756ee68

Browse files
committed
Remove some dead code in the assembler
Summary: There's some code (and a doc string) which says we need to convert from PyFlowGraph to code objects. But that already happens in _convert_LOAD_CONST so this is just unnecessary. Test Plan: ./python -m test.test_compiler
1 parent e783e45 commit 756ee68

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

compiler/pyassem.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -657,17 +657,9 @@ def newCodeObject(self):
657657
tuple(self.cellvars))
658658

659659
def getConsts(self):
660-
"""Return a tuple for the const slot of the code object
661-
662-
Must convert references to code (MAKE_FUNCTION) to code
663-
objects recursively.
664-
"""
665-
l = []
666-
for t, elt in self.consts:
667-
if isinstance(elt, PyFlowGraph):
668-
elt = elt.getCode()
669-
l.append(elt)
670-
return tuple(l)
660+
"""Return a tuple for the const slot of the code object"""
661+
# Just return the constant value, removing the type portion.
662+
return tuple(const[1] for const in self.consts)
671663

672664
def isJump(opname):
673665
if opname[:4] == 'JUMP':

0 commit comments

Comments
 (0)