commit | 17a74c395eafa98e7dcdeaa8a48110e95b142b66 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Sat Feb 09 04:37:49 2008 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Sat Feb 09 04:37:49 2008 +0000 |
tree | 971dcfcf56ead21ef19b6576205e99babfe54c8d | |
parent | 2e827bfdfea7b940517f90af78c986aec9159d2c [diff] [blame] |
Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index eaa490e..165221e 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c
@@ -1528,6 +1528,10 @@ 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); }