summaryrefslogtreecommitdiff
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-09 04:37:49 +0000
committerRaymond Hettinger <python@rcn.com>2008-02-09 04:37:49 +0000
commita6e484b8ed8a866ffd4eae1cbf4984b214b273ba (patch)
tree3446118d74b00d8457fd893927f9de91ef60d040 /Objects/dictobject.c
parenteeef9a2cdfbc13f9dd93697d9351f16a95909aa1 (diff)
downloadcpython-a6e484b8ed8a866ffd4eae1cbf4984b214b273ba.tar.gz
Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index eaa490e320..165221e8d4 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1528,6 +1528,10 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
static PyObject *
dict_copy(register PyDictObject *mp)
{
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "dict.copy() not supported in 3.x") < 0)
+ return NULL;
return PyDict_Copy((PyObject*)mp);
}