Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 549cb6e

Browse files
committed
Added a module docstring (that's all this module needs).
1 parent 0618f5e commit 549cb6e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Modules/errnomodule.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,25 @@ _inscode(d, de, name, code)
8080
Py_XDECREF(v);
8181
}
8282

83+
static char errno__doc__ [] =
84+
"This module makes available standard errno system symbols.\n\
85+
\n\
86+
The value of each symbol is the corresponding integer value,\n\
87+
e.g., on most systems, errno.ENOENT equals the integer 2.\n\
88+
\n\
89+
The dictionary errno.errorcode maps numeric codes to symbol names,\n\
90+
e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\
91+
\n\
92+
Symbols that are not relevant to the underlying system are not defined.\n\
93+
\n\
94+
To map error codes to error messages, use the function os.strerror(),\n\
95+
e.g. os.strerror(2) could return 'No such file or directory'.";
96+
8397
void
8498
initerrno()
8599
{
86100
PyObject *m, *d, *de;
87-
m = Py_InitModule("errno", errno_methods);
101+
m = Py_InitModule3("errno", errno_methods, errno__doc__);
88102
d = PyModule_GetDict(m);
89103
de = PyDict_New();
90104
if (de == NULL || PyDict_SetItemString(d,"errorcode",de))

0 commit comments

Comments
 (0)