summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 19:09:09 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 19:20:43 -0700
commit103bf3ecccf7f5d048385b0494081f140df71cc4 (patch)
treee4f42593f0e9cb29c3aa08c1eeed1a2dfd3c127e /src
parent6fbddf912294b96a66f0e18b32c9312c67455ad5 (diff)
downloadpycrypto-103bf3ecccf7f5d048385b0494081f140df71cc4.tar.gz
Py3k cleanup: bytes/string -> bytestring in error messages
Diffstat (limited to 'src')
-rw-r--r--src/block_template.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/block_template.c b/src/block_template.c
index 94ad224..d932ce9 100644
--- a/src/block_template.c
+++ b/src/block_template.c
@@ -408,11 +408,7 @@ ALG_Encrypt(ALGobject *self, PyObject *args)
if (!PyBytes_Check(ctr))
{
PyErr_SetString(PyExc_TypeError,
-#ifdef IS_PY3K
- "CTR counter function didn't return bytes");
-#else
- "CTR counter function didn't return a string");
-#endif
+ "CTR counter function didn't return a bytestring");
Py_DECREF(ctr);
free(buffer);
return NULL;
@@ -420,11 +416,7 @@ ALG_Encrypt(ALGobject *self, PyObject *args)
if (PyBytes_Size(ctr) != BLOCK_SIZE) {
PyErr_Format(PyExc_TypeError,
"CTR counter function returned "
-#ifdef IS_PY3K
- "bytes not of length %i",
-#else
- "string not of length %i",
-#endif
+ "bytestring not of length %i",
BLOCK_SIZE);
Py_DECREF(ctr);
free(buffer);
@@ -610,11 +602,7 @@ ALGsetattr(PyObject *ptr, char *name, PyObject *v)
if (!PyBytes_Check(v))
{
PyErr_SetString(PyExc_TypeError,
-#ifdef IS_PY3K
- "IV attribute of block cipher object must be bytes");
-#else
- "IV attribute of block cipher object must be string");
-#endif
+ "IV attribute of block cipher object must be bytestring");
return -1;
}
if (PyBytes_Size(v)!=BLOCK_SIZE)