]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a module docstring (that's all this module needs).
authorGuido van Rossum <guido@python.org>
Tue, 11 Aug 1998 17:50:22 +0000 (17:50 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 11 Aug 1998 17:50:22 +0000 (17:50 +0000)
Modules/errnomodule.c

index 2b15d71fdcb5610d75c05312fe84bae199ec38ed..8120075ba3e41be7b488bf70c18c46d5d1afa8af 100644 (file)
@@ -80,11 +80,25 @@ _inscode(d, de, name, code)
        Py_XDECREF(v);
 }
 
+static char errno__doc__ [] =
+"This module makes available standard errno system symbols.\n\
+\n\
+The value of each symbol is the corresponding integer value,\n\
+e.g., on most systems, errno.ENOENT equals the integer 2.\n\
+\n\
+The dictionary errno.errorcode maps numeric codes to symbol names,\n\
+e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\
+\n\
+Symbols that are not relevant to the underlying system are not defined.\n\
+\n\
+To map error codes to error messages, use the function os.strerror(),\n\
+e.g. os.strerror(2) could return 'No such file or directory'.";
+
 void
 initerrno()
 {
        PyObject *m, *d, *de;
-       m = Py_InitModule("errno", errno_methods);
+       m = Py_InitModule3("errno", errno_methods, errno__doc__);
        d = PyModule_GetDict(m);
        de = PyDict_New();
        if (de == NULL || PyDict_SetItemString(d,"errorcode",de))