mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x
This commit is contained in:
parent
2e827bfdfe
commit
17a74c395e
3 changed files with 31 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue