Mercurial > cpython-lru_cache-weakref
view Modules/cryptmodule.c @ 11571:07d2ea71acdc legacy-trunk
Only set msg.fp to None when there are no extra arguments; if there
are, we must keep the file around so we can print the body.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 14 Dec 1999 22:18:37 +0000 |
| parents | 38023a425e48 |
| children | 47d70f4f635f |
line wrap: on
line source
/* cryptmodule.c - by Steve Majewski */ #include "Python.h" #include <sys/types.h> /* Module crypt */ static PyObject *crypt_crypt(self, args) PyObject *self, *args; { char *word, *salt; extern char * crypt(); if (!PyArg_Parse(args, "(ss)", &word, &salt)) { return NULL; } return PyString_FromString( crypt( word, salt ) ); } static PyMethodDef crypt_methods[] = { {"crypt", crypt_crypt}, {NULL, NULL} /* sentinel */ }; DL_EXPORT(void) initcrypt() { Py_InitModule("crypt", crypt_methods); }
