mirror of
https://github.com/python/cpython.git
synced 2025-09-14 20:56:06 +00:00
Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.
This commit is contained in:
parent
a8b09fd4c3
commit
ae42f33cdf
6 changed files with 166 additions and 3 deletions
|
@ -54,6 +54,12 @@ cell_dealloc(PyCellObject *op)
|
|||
static int
|
||||
cell_compare(PyCellObject *a, PyCellObject *b)
|
||||
{
|
||||
/* Py3K warning for comparisons */
|
||||
if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"cell comparisons not supported in 3.x.") < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (a->ob_ref == NULL) {
|
||||
if (b->ob_ref == NULL)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue