summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-25 07:56:27 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-25 07:56:27 (GMT)
commit80055f6295dd48274ae68d13806c7ee3c5b5882f (patch)
treef3f85b8ad80c573bc28b38c666603d61031c47d3 /Objects
parentaef3e529e2c2fc12a91bb126d39b039ab7e402f9 (diff)
downloadcpython-80055f6295dd48274ae68d13806c7ee3c5b5882f.zip
cpython-80055f6295dd48274ae68d13806c7ee3c5b5882f.tar.gz
cpython-80055f6295dd48274ae68d13806c7ee3c5b5882f.tar.bz2
#2355: py3k warning for buffer().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bufferobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c
index e01938c..0a818d6 100644
--- a/Objects/bufferobject.c
+++ b/Objects/bufferobject.c
@@ -229,6 +229,11 @@ PyBuffer_New(Py_ssize_t size)
static PyObject *
buffer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{
+ if (Py_Py3kWarningFlag &&
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "buffer will be removed in 3.x", 1) < 0)
+ return NULL;
+
PyObject *ob;
Py_ssize_t offset = 0;
Py_ssize_t size = Py_END_OF_BUFFER;