Mercurial > cpython-lru_cache-weakref
annotate Include/pyerrors.h @ 40908:d01bd37bf5ce legacy-trunk
Variation of patch # 1624059 to speed up checking if an object is a subclass
of some of the common builtin types.
Use a bit in tp_flags for each common builtin type. Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().
All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types. Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags). Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 25 Feb 2007 19:44:48 +0000 |
| parents | 635b09b1f542 |
| children | 37189e375ec7 |
| 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 |
|
38431
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
7 /* Error objects */ |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
8 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
9 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
10 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
11 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
12 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
13 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
14 } PyBaseExceptionObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
15 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
16 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
17 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
18 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
19 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
20 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
21 PyObject *msg; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
22 PyObject *filename; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
23 PyObject *lineno; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
24 PyObject *offset; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
25 PyObject *text; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
26 PyObject *print_file_and_line; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
27 } PySyntaxErrorObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
28 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
29 #ifdef Py_USING_UNICODE |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
30 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
31 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
32 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
33 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
34 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
35 PyObject *encoding; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
36 PyObject *object; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
37 PyObject *start; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
38 PyObject *end; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
39 PyObject *reason; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
40 } PyUnicodeErrorObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
41 #endif |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
42 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
43 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
44 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
45 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
46 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
47 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
48 PyObject *code; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
49 } PySystemExitObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
50 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
51 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
52 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
53 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
54 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
55 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
56 PyObject *myerrno; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
57 PyObject *strerror; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
58 PyObject *filename; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
59 } PyEnvironmentErrorObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
60 |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
61 #ifdef MS_WINDOWS |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
62 typedef struct { |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
63 PyObject_HEAD |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
64 PyObject *dict; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
65 PyObject *args; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
66 PyObject *message; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
67 PyObject *myerrno; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
68 PyObject *strerror; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
69 PyObject *filename; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
70 PyObject *winerror; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
71 } PyWindowsErrorObject; |
|
4c0823f0a0a1
Conversion of exceptions over from faked-up classes to new-style C types.
Richard Jones <richard@commonground.com.au>
parents:
38018
diff
changeset
|
72 #endif |
| 145 | 73 |
| 6 | 74 /* Error handling definitions */ |
| 75 | |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
76 PyAPI_FUNC(void) PyErr_SetNone(PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
77 PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
78 PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
79 PyAPI_FUNC(PyObject *) PyErr_Occurred(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
80 PyAPI_FUNC(void) PyErr_Clear(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
81 PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
82 PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); |
| 6 | 83 |
|
35316
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
84 #ifdef Py_DEBUG |
|
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
85 #define _PyErr_OCCURRED() PyErr_Occurred() |
|
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
86 #else |
|
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
87 #define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type) |
|
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
88 #endif |
|
ce0995e01d3c
* set_new() doesn't need to zero the structure a second time after tp_alloc
Raymond Hettinger <python@rcn.com>
parents:
35298
diff
changeset
|
89 |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
90 /* Error testing and normalization */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
91 PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
92 PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
93 PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
94 |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
95 /* */ |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
96 |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
97 #define PyExceptionClass_Check(x) \ |
|
40908
d01bd37bf5ce
Variation of patch # 1624059 to speed up checking if an object is a subclass
Neal Norwitz <nnorwitz@gmail.com>
parents:
39487
diff
changeset
|
98 (PyClass_Check((x)) || (PyType_Check((x)) && \ |
|
d01bd37bf5ce
Variation of patch # 1624059 to speed up checking if an object is a subclass
Neal Norwitz <nnorwitz@gmail.com>
parents:
39487
diff
changeset
|
99 PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))) |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
100 |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
101 #define PyExceptionInstance_Check(x) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
102 (PyInstance_Check((x)) || \ |
|
40908
d01bd37bf5ce
Variation of patch # 1624059 to speed up checking if an object is a subclass
Neal Norwitz <nnorwitz@gmail.com>
parents:
39487
diff
changeset
|
103 PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)) |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
104 |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
105 #define PyExceptionClass_Name(x) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
106 (PyClass_Check((x)) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
107 ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
108 : (char *)(((PyTypeObject*)(x))->tp_name)) |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
109 |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
110 #define PyExceptionInstance_Class(x) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
111 ((PyInstance_Check((x)) \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
112 ? (PyObject*)((PyInstanceObject*)(x))->in_class \ |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
113 : (PyObject*)((x)->ob_type))) |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
114 |
|
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
115 |
| 86 | 116 /* Predefined exceptions */ |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
117 |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
118 PyAPI_DATA(PyObject *) PyExc_BaseException; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
119 PyAPI_DATA(PyObject *) PyExc_Exception; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
120 PyAPI_DATA(PyObject *) PyExc_StopIteration; |
|
35298
b2fe5f8fcfdd
PEP 342 implementation. Per Guido's comments, the generator throw()
Phillip J. Eby <pje@telecommunity.com>
parents:
33256
diff
changeset
|
121 PyAPI_DATA(PyObject *) PyExc_GeneratorExit; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
122 PyAPI_DATA(PyObject *) PyExc_StandardError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
123 PyAPI_DATA(PyObject *) PyExc_ArithmeticError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
124 PyAPI_DATA(PyObject *) PyExc_LookupError; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
125 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
126 PyAPI_DATA(PyObject *) PyExc_AssertionError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
127 PyAPI_DATA(PyObject *) PyExc_AttributeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
128 PyAPI_DATA(PyObject *) PyExc_EOFError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
129 PyAPI_DATA(PyObject *) PyExc_FloatingPointError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
130 PyAPI_DATA(PyObject *) PyExc_EnvironmentError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
131 PyAPI_DATA(PyObject *) PyExc_IOError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
132 PyAPI_DATA(PyObject *) PyExc_OSError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
133 PyAPI_DATA(PyObject *) PyExc_ImportError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
134 PyAPI_DATA(PyObject *) PyExc_IndexError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
135 PyAPI_DATA(PyObject *) PyExc_KeyError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
136 PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
137 PyAPI_DATA(PyObject *) PyExc_MemoryError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
138 PyAPI_DATA(PyObject *) PyExc_NameError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
139 PyAPI_DATA(PyObject *) PyExc_OverflowError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
140 PyAPI_DATA(PyObject *) PyExc_RuntimeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
141 PyAPI_DATA(PyObject *) PyExc_NotImplementedError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
142 PyAPI_DATA(PyObject *) PyExc_SyntaxError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
143 PyAPI_DATA(PyObject *) PyExc_IndentationError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
144 PyAPI_DATA(PyObject *) PyExc_TabError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
145 PyAPI_DATA(PyObject *) PyExc_ReferenceError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
146 PyAPI_DATA(PyObject *) PyExc_SystemError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
147 PyAPI_DATA(PyObject *) PyExc_SystemExit; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
148 PyAPI_DATA(PyObject *) PyExc_TypeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
149 PyAPI_DATA(PyObject *) PyExc_UnboundLocalError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
150 PyAPI_DATA(PyObject *) PyExc_UnicodeError; |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
151 PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError; |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
152 PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError; |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
153 PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
154 PyAPI_DATA(PyObject *) PyExc_ValueError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
155 PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
156 #ifdef MS_WINDOWS |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
157 PyAPI_DATA(PyObject *) PyExc_WindowsError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
158 #endif |
|
26550
b9c912e2c3c0
Patch #614055: Support OpenVMS.
Martin v. Löwis <martin@v.loewis.de>
parents:
26318
diff
changeset
|
159 #ifdef __VMS |
|
29726
85e52ec85629
Use appropriate macros not the deprecated DL_IMPORT/DL_EXPORT macros
Neal Norwitz <nnorwitz@gmail.com>
parents:
26601
diff
changeset
|
160 PyAPI_DATA(PyObject *) PyExc_VMSError; |
|
26550
b9c912e2c3c0
Patch #614055: Support OpenVMS.
Martin v. Löwis <martin@v.loewis.de>
parents:
26318
diff
changeset
|
161 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
162 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
163 PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
164 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
165 /* Predefined warning categories */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
166 PyAPI_DATA(PyObject *) PyExc_Warning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
167 PyAPI_DATA(PyObject *) PyExc_UserWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
168 PyAPI_DATA(PyObject *) PyExc_DeprecationWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
169 PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
170 PyAPI_DATA(PyObject *) PyExc_SyntaxWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
171 PyAPI_DATA(PyObject *) PyExc_RuntimeWarning; |
|
24818
31d2860089e6
Added a FutureWarning for constructs that will change semantically in
Barry Warsaw <barry@python.org>
parents:
24752
diff
changeset
|
172 PyAPI_DATA(PyObject *) PyExc_FutureWarning; |
|
38018
b5e7d5b3c442
- Add new Warning class, ImportWarning
Thomas Wouters <thomas@python.org>
parents:
36751
diff
changeset
|
173 PyAPI_DATA(PyObject *) PyExc_ImportWarning; |
|
39487
635b09b1f542
Slightly revised version of patch #1538956:
Marc-André Lemburg <mal@egenix.com>
parents:
39301
diff
changeset
|
174 PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
175 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
176 |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
177 /* Convenience functions */ |
|
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
178 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
179 PyAPI_FUNC(int) PyErr_BadArgument(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
180 PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
181 PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
182 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
183 PyObject *, PyObject *); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
184 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
185 #ifdef Py_WIN_WIDE_FILENAMES |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
186 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
187 PyObject *, Py_UNICODE *); |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
188 #endif /* Py_WIN_WIDE_FILENAMES */ |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
189 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
190 PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) |
|
25276
6c21e95a4881
Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
25094
diff
changeset
|
191 Py_GCC_ATTRIBUTE((format(printf, 2, 3))); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
192 |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
193 #ifdef MS_WINDOWS |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
194 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
195 int, const char *); |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
196 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
197 int, const char *); |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
198 #ifdef Py_WIN_WIDE_FILENAMES |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
199 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
200 int, const Py_UNICODE *); |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
201 #endif /* Py_WIN_WIDE_FILENAMES */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
202 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
203 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
204 PyObject *,int, PyObject *); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
205 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( |
|
24423
3db261a93a5b
New functions for extension writers on Windows:
Thomas Heller <theller@ctypes.org>
parents:
23564
diff
changeset
|
206 PyObject *,int, const char *); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
207 #ifdef Py_WIN_WIDE_FILENAMES |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
208 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
209 PyObject *,int, const Py_UNICODE *); |
|
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
210 #endif /* Py_WIN_WIDE_FILENAMES */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
211 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
212 #endif /* MS_WINDOWS */ |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
213 |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
214 /* Export the old function so that the existing API remains available: */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
215 PyAPI_FUNC(void) PyErr_BadInternalCall(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
216 PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno); |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
217 /* 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
|
218 Python 2.0: */ |
|
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
219 #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
220 |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
221 /* Function to create a new exception */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
222 PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base, |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
223 PyObject *dict); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
224 PyAPI_FUNC(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
|
225 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
226 /* Issue a warning or exception */ |
|
39301
7dc5f3ede4cd
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
Neal Norwitz <nnorwitz@gmail.com>
parents:
38431
diff
changeset
|
227 PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, |
|
7dc5f3ede4cd
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
Neal Norwitz <nnorwitz@gmail.com>
parents:
38431
diff
changeset
|
228 Py_ssize_t stack_level); |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
229 PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
230 const char *, int, |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
231 const char *, PyObject *); |
|
39301
7dc5f3ede4cd
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
Neal Norwitz <nnorwitz@gmail.com>
parents:
38431
diff
changeset
|
232 /* PyErr_Warn is only for backwards compatability and will be removed. |
|
7dc5f3ede4cd
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
Neal Norwitz <nnorwitz@gmail.com>
parents:
38431
diff
changeset
|
233 Use PyErr_WarnEx instead. */ |
|
7dc5f3ede4cd
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
Neal Norwitz <nnorwitz@gmail.com>
parents:
38431
diff
changeset
|
234 #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
235 |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
236 /* In sigcheck.c or signalmodule.c */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
237 PyAPI_FUNC(int) PyErr_CheckSignals(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
238 PyAPI_FUNC(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
|
239 |
|
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
240 /* Support for adding program text to SyntaxErrors */ |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
241 PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int); |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
242 PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int); |
|
21070
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
243 |
|
26318
910fa739f4a4
Fix PEP 293 related problems with --disable-unicode builds
Walter Dörwald <walter@livinglogic.de>
parents:
25535
diff
changeset
|
244 #ifdef Py_USING_UNICODE |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
245 /* The following functions are used to create and modify unicode |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
246 exceptions from C */ |
|
26318
910fa739f4a4
Fix PEP 293 related problems with --disable-unicode builds
Walter Dörwald <walter@livinglogic.de>
parents:
25535
diff
changeset
|
247 |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
248 /* create a UnicodeDecodeError object */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
249 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
250 const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
251 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
252 /* create a UnicodeEncodeError object */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
253 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
254 const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
255 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
256 /* create a UnicodeTranslateError object */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
257 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
258 const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
259 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
260 /* get the encoding attribute */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
261 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
262 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
263 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
264 /* get the object attribute */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
265 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
266 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
267 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
268 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
269 /* get the value of the start attribute (the int * may not be NULL) |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
270 return 0 on success, -1 on failure */ |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
271 PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
272 PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
273 PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
274 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
275 /* assign a new value to the start attribute |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
276 return 0 on success, -1 on failure */ |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
277 PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
278 PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
279 PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
280 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
281 /* get the value of the end attribute (the int *may not be NULL) |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
282 return 0 on success, -1 on failure */ |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
283 PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
284 PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
285 PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
286 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
287 /* assign a new value to the end attribute |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
288 return 0 on success, -1 on failure */ |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
289 PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
290 PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t); |
|
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
291 PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t); |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
292 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
293 /* get the value of the reason attribute */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
294 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
295 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
296 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
297 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
298 /* assign a new value to the reason attribute |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
299 return 0 on success, -1 on failure */ |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
300 PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason( |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
301 PyObject *, const char *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
302 PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason( |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
303 PyObject *, const char *); |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
304 PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
305 PyObject *, const char *); |
|
26318
910fa739f4a4
Fix PEP 293 related problems with --disable-unicode builds
Walter Dörwald <walter@livinglogic.de>
parents:
25535
diff
changeset
|
306 #endif |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
307 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
308 |
|
18908
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
309 /* These APIs aren't really part of the error implementation, but |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
310 often needed to format error messages; the native C lib APIs are |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
311 not available on all platforms, which is why we provide emulations |
|
21070
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
312 for those platforms in Python/mysnprintf.c, |
|
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
313 WARNING: The return value of snprintf varies across platforms; do |
|
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
314 not rely on any particular behavior; eventually the C99 defn may |
|
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
315 be reliable. |
|
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
316 */ |
|
18908
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
317 #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
318 # define HAVE_SNPRINTF |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
319 # define snprintf _snprintf |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
320 # define vsnprintf _vsnprintf |
|
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
321 #endif |
|
18915
510f7f6a877e
Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 and
Marc-André Lemburg <mal@egenix.com>
parents:
18909
diff
changeset
|
322 |
|
18909
9753b0269f3a
va_list is defined in stdarg.h.
Marc-André Lemburg <mal@egenix.com>
parents:
18908
diff
changeset
|
323 #include <stdarg.h> |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
324 PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) |
|
25276
6c21e95a4881
Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
25094
diff
changeset
|
325 Py_GCC_ATTRIBUTE((format(printf, 3, 4))); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
326 PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) |
|
25276
6c21e95a4881
Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
25094
diff
changeset
|
327 Py_GCC_ATTRIBUTE((format(printf, 3, 0))); |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
328 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
329 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
330 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
331 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
332 #endif /* !Py_ERRORS_H */ |
