diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-11-07 02:56:11 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-11-07 02:56:11 (GMT) |
commit | 61d6e4ae9db80e3f87104a03499ff89d3c275b22 (patch) | |
tree | 43160e9ff162635bb549ad31b7be875935cf0b86 /Objects/complexobject.c | |
parent | 9b566c324d2eb3ddbf00d5d7a78bea63cde4d15f (diff) | |
parent | eeb896c4116dd763efea45cb3c1b53257128f4e4 (diff) | |
download | cpython-61d6e4ae9db80e3f87104a03499ff89d3c275b22.zip cpython-61d6e4ae9db80e3f87104a03499ff89d3c275b22.tar.gz cpython-61d6e4ae9db80e3f87104a03499ff89d3c275b22.tar.bz2 |
Issue #24802: Merge null termination fixes from 3.4 into 3.5
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index dc1212e..a5bfb66 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -767,7 +767,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) int got_bracket=0; PyObject *s_buffer = NULL; Py_ssize_t len; - Py_buffer view = {NULL, NULL}; if (PyUnicode_Check(v)) { s_buffer = _PyUnicode_TransformDecimalAndSpaceToASCII(v); @@ -777,10 +776,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) if (s == NULL) goto error; } - else if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) == 0) { - s = (const char *)view.buf; - len = view.len; - } else { PyErr_Format(PyExc_TypeError, "complex() argument must be a string or a number, not '%.200s'", @@ -895,7 +890,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) if (s-start != len) goto parse_error; - PyBuffer_Release(&view); Py_XDECREF(s_buffer); return complex_subtype_from_doubles(type, x, y); @@ -903,7 +897,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) PyErr_SetString(PyExc_ValueError, "complex() arg is a malformed string"); error: - PyBuffer_Release(&view); Py_XDECREF(s_buffer); return NULL; } |