There was an error while loading. Please reload this page.
1 parent 0618f5e commit 549cb6eCopy full SHA for 549cb6e
1 file changed
Modules/errnomodule.c
@@ -80,11 +80,25 @@ _inscode(d, de, name, code)
80
Py_XDECREF(v);
81
}
82
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
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
92
+Symbols that are not relevant to the underlying system are not defined.\n\
93
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
+
97
void
98
initerrno()
99
{
100
PyObject *m, *d, *de;
- m = Py_InitModule("errno", errno_methods);
101
+ m = Py_InitModule3("errno", errno_methods, errno__doc__);
102
d = PyModule_GetDict(m);
103
de = PyDict_New();
104
if (de == NULL || PyDict_SetItemString(d,"errorcode",de))
0 commit comments