From 17a74c395eafa98e7dcdeaa8a48110e95b142b66 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 9 Feb 2008 04:37:49 +0000 Subject: Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x --- Objects/dictobject.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Objects/dictobject.c') 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); } -- cgit v1.2.1