Skip to content

Commit ff2d397

Browse files
committed
gh-107162: Document errcode.h usage in its comment
1 parent 0a9b339 commit ff2d397

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

Include/errcode.h

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
// Error codes passed around between file input, tokenizer, parser and
2+
// interpreter. This is necessary so we can turn them into Python
3+
// exceptions at a higher level. Note that some errors have a
4+
// slightly different meaning when passed from the tokenizer to the
5+
// parser than when passed from the parser to the interpreter; e.g.
6+
// the parser only returns E_EOF when it hits EOF immediately, and it
7+
// never returns E_OK.
8+
//
9+
// The public PyRun_InteractiveOneObjectEx() function can return E_EOF,
10+
// same as its variants:
11+
//
12+
// * PyRun_InteractiveOneObject()
13+
// * PyRun_InteractiveOneFlags()
14+
// * PyRun_InteractiveOne()
15+
116
#ifndef Py_ERRCODE_H
217
#define Py_ERRCODE_H
318
#ifdef __cplusplus
419
extern "C" {
520
#endif
621

7-
8-
/* Error codes passed around between file input, tokenizer, parser and
9-
interpreter. This is necessary so we can turn them into Python
10-
exceptions at a higher level. Note that some errors have a
11-
slightly different meaning when passed from the tokenizer to the
12-
parser than when passed from the parser to the interpreter; e.g.
13-
the parser only returns E_EOF when it hits EOF immediately, and it
14-
never returns E_OK. */
15-
1622
#define E_OK 10 /* No error */
1723
#define E_EOF 11 /* End Of File */
1824
#define E_INTR 12 /* Interrupted */

0 commit comments

Comments
 (0)