Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.

This commit is contained in:
Steven Bethard 2008-03-18 17:26:10 +00:00
parent a8b09fd4c3
commit ae42f33cdf
6 changed files with 166 additions and 3 deletions

View file

@ -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;