diff options
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index b6a4821..b3b7441 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -1402,16 +1402,8 @@ dummy_func( inst(LOAD_COMMON_CONSTANT, ( -- value)) { // Keep in sync with _common_constants in opcode.py - // If we ever have more than two constants, use a lookup table - PyObject *val; - if (oparg == CONSTANT_ASSERTIONERROR) { - val = PyExc_AssertionError; - } - else { - assert(oparg == CONSTANT_NOTIMPLEMENTEDERROR); - val = PyExc_NotImplementedError; - } - value = PyStackRef_FromPyObjectImmortal(val); + assert(oparg < NUM_COMMON_CONSTANTS); + value = PyStackRef_FromPyObjectNew(tstate->interp->common_consts[oparg]); } inst(LOAD_BUILD_CLASS, ( -- bc)) { |