Mercurial > cpython-lru_cache-weakref
annotate Include/pyerrors.h @ 17581:c1937faabb23 2.1
Added support for optional explanation parameter to the \versionadded
macro.
Refactored do_cmd_versionadded() and do_cmd_versionchanged() to do most
of the work in a helper function, with the do_cmd_*() wrappers just supplying
a portion of the replacement text.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Wed, 18 Apr 2001 17:29:14 +0000 |
| parents | a8771a52abb3 |
| children | 32e7d0898eab |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
1 #ifndef Py_ERRORS_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
2 #define Py_ERRORS_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
6 |
| 145 | 7 |
| 6 | 8 /* Error handling definitions */ |
| 9 | |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
10 DL_IMPORT(void) PyErr_SetNone(PyObject *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
11 DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
12 DL_IMPORT(void) PyErr_SetString(PyObject *, const char *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
13 DL_IMPORT(PyObject *) PyErr_Occurred(void); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
14 DL_IMPORT(void) PyErr_Clear(void); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
15 DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
16 DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); |
| 6 | 17 |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
18 /* Error testing and normalization */ |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
19 DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
20 DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
21 DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
22 |
|
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
23 |
| 86 | 24 /* Predefined exceptions */ |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
25 |
|
6318
cdc5a40fcf97
Introduce PyExc_Exception as the conceptual root class for all exceptions.
Guido van Rossum <guido@python.org>
parents:
6191
diff
changeset
|
26 extern DL_IMPORT(PyObject *) PyExc_Exception; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
27 extern DL_IMPORT(PyObject *) PyExc_StandardError; |
|
6323
3f8d7f74f1bc
[Py_Exc]NumberError => [Py_Exc]ArithmeticError
Barry Warsaw <barry@python.org>
parents:
6318
diff
changeset
|
28 extern DL_IMPORT(PyObject *) PyExc_ArithmeticError; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
29 extern DL_IMPORT(PyObject *) PyExc_LookupError; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
30 |
| 5230 | 31 extern DL_IMPORT(PyObject *) PyExc_AssertionError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
32 extern DL_IMPORT(PyObject *) PyExc_AttributeError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
33 extern DL_IMPORT(PyObject *) PyExc_EOFError; |
|
5117
2bb0bda1585c
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
5106
diff
changeset
|
34 extern DL_IMPORT(PyObject *) PyExc_FloatingPointError; |
|
8703
50757465fa70
New global variables: PyExc_EnvironmentError and PyExc_OSError
Barry Warsaw <barry@python.org>
parents:
6324
diff
changeset
|
35 extern DL_IMPORT(PyObject *) PyExc_EnvironmentError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
36 extern DL_IMPORT(PyObject *) PyExc_IOError; |
|
8703
50757465fa70
New global variables: PyExc_EnvironmentError and PyExc_OSError
Barry Warsaw <barry@python.org>
parents:
6324
diff
changeset
|
37 extern DL_IMPORT(PyObject *) PyExc_OSError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
38 extern DL_IMPORT(PyObject *) PyExc_ImportError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
39 extern DL_IMPORT(PyObject *) PyExc_IndexError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
40 extern DL_IMPORT(PyObject *) PyExc_KeyError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
41 extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
42 extern DL_IMPORT(PyObject *) PyExc_MemoryError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
43 extern DL_IMPORT(PyObject *) PyExc_NameError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
44 extern DL_IMPORT(PyObject *) PyExc_OverflowError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
45 extern DL_IMPORT(PyObject *) PyExc_RuntimeError; |
|
9564
d13a60b44b45
Added PyExc_NotImplementedError
Barry Warsaw <barry@python.org>
parents:
8703
diff
changeset
|
46 extern DL_IMPORT(PyObject *) PyExc_NotImplementedError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
47 extern DL_IMPORT(PyObject *) PyExc_SyntaxError; |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
48 extern DL_IMPORT(PyObject *) PyExc_IndentationError; |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
49 extern DL_IMPORT(PyObject *) PyExc_TabError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
50 extern DL_IMPORT(PyObject *) PyExc_SystemError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
51 extern DL_IMPORT(PyObject *) PyExc_SystemExit; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
52 extern DL_IMPORT(PyObject *) PyExc_TypeError; |
| 11030 | 53 extern DL_IMPORT(PyObject *) PyExc_UnboundLocalError; |
|
11963
24199c1b9182
Marc-Andre Lemburg: add PyExc_UnicodeError
Guido van Rossum <guido@python.org>
parents:
11799
diff
changeset
|
54 extern DL_IMPORT(PyObject *) PyExc_UnicodeError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
55 extern DL_IMPORT(PyObject *) PyExc_ValueError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
56 extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
57 #ifdef MS_WINDOWS |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
58 extern DL_IMPORT(PyObject *) PyExc_WindowsError; |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
59 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
60 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
61 extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
62 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
63 /* Predefined warning categories */ |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
64 extern DL_IMPORT(PyObject *) PyExc_Warning; |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
65 extern DL_IMPORT(PyObject *) PyExc_UserWarning; |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
66 extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning; |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
67 extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning; |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
68 extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning; |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
69 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
70 |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
71 /* Convenience functions */ |
|
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
72 |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
73 extern DL_IMPORT(int) PyErr_BadArgument(void); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
74 extern DL_IMPORT(PyObject *) PyErr_NoMemory(void); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
75 extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
76 extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
77 extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...); |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
78 #ifdef MS_WINDOWS |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
79 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *); |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
80 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int); |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
81 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
82 |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
83 /* Export the old function so that the existing API remains available: */ |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
84 extern DL_IMPORT(void) PyErr_BadInternalCall(void); |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
85 extern DL_IMPORT(void) _PyErr_BadInternalCall(char *filename, int lineno); |
|
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
86 /* Mask the old API with a call to the new API for code compiled under |
|
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
87 Python 2.0: */ |
|
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
88 #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
89 |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
90 /* Function to create a new exception */ |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
91 DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base, |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
92 PyObject *dict); |
|
14330
6dee1985c681
refactor __del__ exception handler into PyErr_WriteUnraisable
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
14170
diff
changeset
|
93 extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *); |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
94 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
95 /* Issue a warning or exception */ |
|
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
96 extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *); |
|
16849
a8771a52abb3
Add declaration for PyErr_WarnExplicit().
Guido van Rossum <guido@python.org>
parents:
16838
diff
changeset
|
97 extern DL_IMPORT(int) PyErr_WarnExplicit(PyObject *, char *, |
|
a8771a52abb3
Add declaration for PyErr_WarnExplicit().
Guido van Rossum <guido@python.org>
parents:
16838
diff
changeset
|
98 char *, int, char *, PyObject *); |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
99 |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
100 /* In sigcheck.c or signalmodule.c */ |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
101 extern DL_IMPORT(int) PyErr_CheckSignals(void); |
|
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
102 extern DL_IMPORT(void) PyErr_SetInterrupt(void); |
|
16838
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
103 |
|
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
104 /* Support for adding program text to SyntaxErrors */ |
|
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
105 extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int); |
|
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
106 extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int); |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
107 |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
108 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
109 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
110 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
111 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
112 #endif /* !Py_ERRORS_H */ |
