mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
This commit is contained in:
parent
ef107ee7a0
commit
713640c4c9
3 changed files with 9 additions and 3 deletions
|
@ -521,7 +521,7 @@ _PyCode_ConstantKey(PyObject *op)
|
|||
PyTuple_SET_ITEM(tuple, i, item_key);
|
||||
}
|
||||
|
||||
key = PyTuple_Pack(3, Py_TYPE(op), op, tuple);
|
||||
key = PyTuple_Pack(2, tuple, op);
|
||||
Py_DECREF(tuple);
|
||||
}
|
||||
else if (PyFrozenSet_CheckExact(op)) {
|
||||
|
@ -555,7 +555,7 @@ _PyCode_ConstantKey(PyObject *op)
|
|||
if (set == NULL)
|
||||
return NULL;
|
||||
|
||||
key = PyTuple_Pack(3, Py_TYPE(op), op, set);
|
||||
key = PyTuple_Pack(2, set, op);
|
||||
Py_DECREF(set);
|
||||
return key;
|
||||
}
|
||||
|
@ -566,7 +566,7 @@ _PyCode_ConstantKey(PyObject *op)
|
|||
if (obj_id == NULL)
|
||||
return NULL;
|
||||
|
||||
key = PyTuple_Pack(3, Py_TYPE(op), op, obj_id);
|
||||
key = PyTuple_Pack(2, obj_id, op);
|
||||
Py_DECREF(obj_id);
|
||||
}
|
||||
return key;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue