summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cryptmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c
index b1c8f5e..5c4ee2f 100644
--- a/Modules/cryptmodule.c
+++ b/Modules/cryptmodule.c
@@ -17,7 +17,9 @@ static PyObject *crypt_crypt(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {
return NULL;
}
- return PyString_FromString( crypt( word, salt ) );
+ /* On some platforms (AtheOS) crypt returns NULL for an invalid
+ salt. Return None in that case. XXX Maybe raise an exception? */
+ return Py_BuildValue("s", crypt(word, salt));
}