[Python-3000-checkins] r66038 - in python/branches/py3k: Doc/c-api/bytes.rst Doc/c-api/object.rst Include/bytesobject.h Include/object.h Lib/test/test_bytes.py Misc/NEWS Objects/bytesobject.c Objects/object.c

Neal Norwitz nnorwitz at gmail.com
Wed Aug 27 01:53:52 CEST 2008


On Tue, Aug 26, 2008 at 9:46 AM, benjamin.peterson
<python-3000-checkins at python.org> wrote:
> Modified: python/branches/py3k/Objects/bytesobject.c
> ==============================================================================
> --- python/branches/py3k/Objects/bytesobject.c  (original)
> +++ python/branches/py3k/Objects/bytesobject.c  Tue Aug 26 18:46:47 2008
> @@ -2924,6 +2923,14 @@
>                        "encoding or errors without a string argument");
>                return NULL;
>        }
> +        return PyObject_Bytes(x);
> +}
> +
> +PyObject *
> +PyBytes_FromObject(PyObject *x)
> +{
> +       PyObject *new, *it;
> +       Py_ssize_t i, size;
>
>        /* Is it an int? */
>        size = PyNumber_AsSsize_t(x, PyExc_ValueError);

What happens if x (the object passed in) is NULL?

n


More information about the Python-3000-checkins mailing list