Author: guido.van.rossum
Date: Wed Aug 29 16:21:45 2007
New Revision: 57659
Modified:
python/branches/py3k/Modules/_hashopenssl.c
Log:
Refuse to compute digests from PyUnicode (str) instances.
This breaks a few things that I'll patch up in a minute.
Modified: python/branches/py3k/Modules/_hashopenssl.c
==============================================================================
--- python/branches/py3k/Modules/_hashopenssl.c (original)
+++ python/branches/py3k/Modules/_hashopenssl.c Wed Aug 29 16:21:45 2007
@@ -153,12 +153,12 @@
}
#define MY_GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \
- if (!PyObject_CheckBuffer((obj))) { \
+ if (PyUnicode_Check(obj) || !PyObject_CheckBuffer((obj))) { \
PyErr_SetString(PyExc_TypeError, \
"object supporting the buffer API
required"); \
return NULL; \
} \
- if (PyObject_GetBuffer((obj), (viewp), PyBUF_CHARACTER) == -1)
{ \
+ if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
return NULL; \
} \
if ((viewp)->ndim > 1) { \
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins