Staging
v0.5.1
https://github.com/python/cpython
Revision ad3d5c2235743f23db54fb5ef2c337a0e21c9548 authored by Benjamin Peterson on 26 February 2009, 03:38:59 UTC, committed by Benjamin Peterson on 26 February 2009, 03:38:59 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r69803 | georg.brandl | 2009-02-20 01:48:21 -0600 (Fri, 20 Feb 2009) | 1 line

  #5327: fix a broken link by joining it.
........
  r69804 | georg.brandl | 2009-02-20 02:22:21 -0600 (Fri, 20 Feb 2009) | 1 line

  At least separate imports from other statements.
........
  r69805 | georg.brandl | 2009-02-20 02:45:47 -0600 (Fri, 20 Feb 2009) | 2 lines

  Fix punctuation.
........
  r69840 | georg.brandl | 2009-02-21 13:09:40 -0600 (Sat, 21 Feb 2009) | 1 line

  #5338, #5339: two types in the API manual.
........
  r69901 | georg.brandl | 2009-02-23 05:24:46 -0600 (Mon, 23 Feb 2009) | 2 lines

  #5349: C++ pure virtuals can also have an implementation.
........
  r69905 | georg.brandl | 2009-02-23 09:51:27 -0600 (Mon, 23 Feb 2009) | 2 lines

  #5352: str.count() counts non-overlapping instances.
........
  r69907 | georg.brandl | 2009-02-23 12:33:48 -0600 (Mon, 23 Feb 2009) | 1 line

  Fix grammar.
........
  r69924 | benjamin.peterson | 2009-02-23 20:45:35 -0600 (Mon, 23 Feb 2009) | 1 line

  update README on running tests
........
  r69927 | neil.schemenauer | 2009-02-23 22:23:25 -0600 (Mon, 23 Feb 2009) | 1 line

  Fix call to os.waitpid, it does not take keyword args.
........
  r69987 | benjamin.peterson | 2009-02-25 18:30:11 -0600 (Wed, 25 Feb 2009) | 1 line

  fix str.format()'s first arg #5371
........
1 parent 40ce6cc
Raw File
Tip revision: ad3d5c2235743f23db54fb5ef2c337a0e21c9548 authored by Benjamin Peterson on 26 February 2009, 03:38:59 UTC
Merged revisions 69803-69805,69840,69901,69905,69907,69924,69927,69987 via svnmerge from
Tip revision: ad3d5c2
hashlib.h
/* Common code for use by all hashlib related modules. */

/*
 * Given a PyObject* obj, fill in the Py_buffer* viewp with the result
 * of PyObject_GetBuffer.  Sets and exception and issues a return NULL
 * on any errors.
 */
#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \
        if (PyUnicode_Check((obj))) { \
            PyErr_SetString(PyExc_TypeError, \
                            "Unicode-objects must be encoded before hashing");\
            return NULL; \
        } \
        if (!PyObject_CheckBuffer((obj))) { \
            PyErr_SetString(PyExc_TypeError, \
                            "object supporting the buffer API required"); \
            return NULL; \
        } \
        if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
            return NULL; \
        } \
        if ((viewp)->ndim > 1) { \
            PyErr_SetString(PyExc_BufferError, \
                            "Buffer must be single dimension"); \
            PyBuffer_Release((viewp)); \
            return NULL; \
        } \
    } while(0);
back to top