Mercurial > cpython-lru_cache-weakref
comparison Objects/memoryobject.c @ 75409:f1441971b621
Issue #14181: Allow memoryview construction from an object that uses the
getbuffer redirection scheme.
| author | Stefan Krah <skrah@bytereef.org> |
|---|---|
| date | Mon, 05 Mar 2012 09:30:47 +0100 |
| parents | 3f9b3b6f7ff0 |
| children | 9f7d06a9eabe |
comparison
equal
deleted
inserted
replaced
| 75408:84d09c1d2b6b | 75409:f1441971b621 |
|---|---|
| 88 if (PyObject_GetBuffer(base, &mbuf->master, PyBUF_FULL_RO) < 0) { | 88 if (PyObject_GetBuffer(base, &mbuf->master, PyBUF_FULL_RO) < 0) { |
| 89 /* mbuf->master.obj must be NULL. */ | 89 /* mbuf->master.obj must be NULL. */ |
| 90 Py_DECREF(mbuf); | 90 Py_DECREF(mbuf); |
| 91 return NULL; | 91 return NULL; |
| 92 } | 92 } |
| 93 | |
| 94 /* Assume that master.obj is a new reference to base. */ | |
| 95 assert(mbuf->master.obj == base); | |
| 96 | 93 |
| 97 return (PyObject *)mbuf; | 94 return (PyObject *)mbuf; |
| 98 } | 95 } |
| 99 | 96 |
| 100 static void | 97 static void |
