diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-06-11 06:22:31 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-06-11 06:22:31 (GMT) |
commit | f90ae20354ceb501f0ba0b6459df17f1a8005a47 (patch) | |
tree | f9aae742cfa33ba10af2ed8152aff802430f626c /Modules/cryptmodule.c | |
parent | 7981ce576c719e291dc901a3463e725b6be3c50e (diff) | |
download | cpython-f90ae20354ceb501f0ba0b6459df17f1a8005a47.zip cpython-f90ae20354ceb501f0ba0b6459df17f1a8005a47.tar.gz cpython-f90ae20354ceb501f0ba0b6459df17f1a8005a47.tar.bz2 |
Patch #488073: AtheOS port.
Diffstat (limited to 'Modules/cryptmodule.c')
-rw-r--r-- | Modules/cryptmodule.c | 4 |
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)); } |