diff options
author | Steven Bethard <steven.bethard@gmail.com> | 2008-03-18 17:26:10 (GMT) |
---|---|---|
committer | Steven Bethard <steven.bethard@gmail.com> | 2008-03-18 17:26:10 (GMT) |
commit | ae42f33cdfb68be2fc71be0fb67ec025f90160e8 (patch) | |
tree | 07985bc750d9266f2e725b6ba46b0f71c17c8d08 /Objects/cellobject.c | |
parent | a8b09fd4c33572a204a80c81e5755cc6d164805d (diff) | |
download | cpython-ae42f33cdfb68be2fc71be0fb67ec025f90160e8.zip cpython-ae42f33cdfb68be2fc71be0fb67ec025f90160e8.tar.gz cpython-ae42f33cdfb68be2fc71be0fb67ec025f90160e8.tar.bz2 |
Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.
Diffstat (limited to 'Objects/cellobject.c')
-rw-r--r-- | Objects/cellobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/cellobject.c b/Objects/cellobject.c index b72d43b..37cde41 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -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; |