diff --git a/Python/compile.c b/Python/compile.c index a0ad3687f586d8..0dc85e11cebf6a 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -892,10 +892,10 @@ static PyObject* merge_consts_recursive(PyObject *const_cache, PyObject *o) { assert(PyDict_CheckExact(const_cache)); - // None and Ellipsis are singleton, and key is the singleton. + // None and Ellipsis are immortal object, and key is the singleton. // No need to merge object and key. if (o == Py_None || o == Py_Ellipsis) { - return Py_NewRef(o); + return o; } PyObject *key = _PyCode_ConstantKey(o);