Skip to content

Commit 28729e0

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

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Include/errcode.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
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 PyRun_InteractiveOneObjectEx() function can return E_EOF, same as its
10+
// variants:
11+
//
12+
// * PyRun_InteractiveOneObject()
13+
// * PyRun_InteractiveOneFlags()
14+
// * PyRun_InteractiveOne()
15+
//
16+
// These error codes are also used by the internal C API of the parser and the
17+
// tokenizer.
18+
119
#ifndef Py_ERRCODE_H
220
#define Py_ERRCODE_H
321
#ifdef __cplusplus
422
extern "C" {
523
#endif
624

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-
1625
#define E_OK 10 /* No error */
1726
#define E_EOF 11 /* End Of File */
1827
#define E_INTR 12 /* Interrupted */

0 commit comments

Comments
 (0)