Mercurial > cpython-lru_cache-weakref
annotate Include/pyerrors.h @ 45852:30c4e1ca8421
Merged revisions 61431,61433-61436,61439,61444,61449-61450,61453,61458,61465,61468,61471-61474,61480,61483-61484,61488,61495-61496,61498,61503-61504,61507,61509-61510,61515-61518 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61431 | vinay.sajip | 2008-03-16 22:35:58 +0100 (So, 16 Mär 2008) | 1 line
Clarified documentation on use of shutdown().
........
r61433 | mark.summerfield | 2008-03-17 09:28:15 +0100 (Mo, 17 Mär 2008) | 5 lines
Added a footnote to each pointing out that for XML output if an encoding
string is given it should conform to the appropriate XML standards---for
example, "UTF-8" is okay, but "UTF8" is not.
........
r61434 | eric.smith | 2008-03-17 12:01:01 +0100 (Mo, 17 Mär 2008) | 7 lines
Issue 2264: empty float presentation type needs to have at least one digit past the decimal point.
Added "Z" format_char to PyOS_ascii_formatd to support empty float presentation type.
Renamed buf_size in PyOS_ascii_formatd to more accurately reflect it's meaning.
Modified format.__float__ to use the new "Z" format as the default.
Added test cases.
........
r61435 | eric.smith | 2008-03-17 13:14:29 +0100 (Mo, 17 Mär 2008) | 2 lines
Reformated lines > 79 chars.
Deleted unused macro ISXDIGIT.
........
r61436 | jeffrey.yasskin | 2008-03-17 15:40:53 +0100 (Mo, 17 Mär 2008) | 13 lines
Allow Gnu gcc's to build python on OSX by removing -Wno-long-double,
-no-cpp-precomp, and -mno-fused-madd from configure.
* r22183 added -no-cpp-precomp, which
http://gcc.gnu.org/ml/gcc/2005-12/msg00368.html claims hasn't been
needed since gcc-3.1.
* r25607 added -Wno-long-double to avoid a warning in
Include/objimpl.h (issue 525481). The long double is still there,
but OSX 10.4's gcc no longer warns about it.
* r33666 fixed issue 775892 on OSX 10.3 by adding -mno-fused-madd,
which changed the sign of some float 0s. Tim Peters said it wasn't
a real issue anyway, and it no longer causes test failures.
Fixes issue #1779871.
........
r61439 | martin.v.loewis | 2008-03-17 17:31:57 +0100 (Mo, 17 Mär 2008) | 2 lines
Add Trent Nelson.
........
r61444 | travis.oliphant | 2008-03-17 18:36:12 +0100 (Mo, 17 Mär 2008) | 1 line
Add necessary headers to back-port new buffer protocol to Python 2.6
........
r61449 | gregory.p.smith | 2008-03-17 19:48:05 +0100 (Mo, 17 Mär 2008) | 8 lines
Force zlib.crc32 and zlib.adler32 to return a signed integer on all platforms
regardless of the native sizeof(long) used in the integer object.
This somewhat odd behavior of returning a signed is maintained in 2.x for
compatibility reasons of always returning an integer rather than a long object.
Fixes Issue1202 for Python 2.6
........
r61450 | neal.norwitz | 2008-03-17 20:02:45 +0100 (Mo, 17 Mär 2008) | 3 lines
Use a buffer large enough to ensure we don't overrun, even if the value
is outside the range we expect.
........
r61453 | steven.bethard | 2008-03-17 20:33:11 +0100 (Mo, 17 Mär 2008) | 1 line
Document unicode.isnumeric() and unicode.isdecimal() (issue2326)
........
r61458 | neal.norwitz | 2008-03-17 21:22:43 +0100 (Mo, 17 Mär 2008) | 5 lines
Issue 2321: reduce memory usage (increase the memory that is returned
to the system) by using pymalloc for the data of unicode objects.
Will backport.
........
r61465 | martin.v.loewis | 2008-03-17 22:55:30 +0100 (Mo, 17 Mär 2008) | 2 lines
Add David Wolever.
........
r61468 | gregory.p.smith | 2008-03-18 01:20:01 +0100 (Di, 18 Mär 2008) | 3 lines
Fix the IOError message text when opening a file with an invalid filename.
Error reported by Ilan Schnell.
........
r61471 | brett.cannon | 2008-03-18 02:00:07 +0100 (Di, 18 Mär 2008) | 2 lines
Convert test_strftime, test_getargs, and test_pep247 to use unittest.
........
r61472 | jeffrey.yasskin | 2008-03-18 02:09:59 +0100 (Di, 18 Mär 2008) | 2 lines
Fix build on platforms that don't have intptr_t. Patch by Joseph Armbruster.
........
r61473 | brett.cannon | 2008-03-18 02:50:25 +0100 (Di, 18 Mär 2008) | 2 lines
Convert test_dummy_threading and test_dbm to unittest.
........
r61474 | brett.cannon | 2008-03-18 02:58:56 +0100 (Di, 18 Mär 2008) | 2 lines
Move test_extcall to doctest.
........
r61480 | brett.cannon | 2008-03-18 04:46:22 +0100 (Di, 18 Mär 2008) | 2 lines
test_errno was a no-op test; now it actually tests things and uses unittest.
........
r61483 | brett.cannon | 2008-03-18 05:09:00 +0100 (Di, 18 Mär 2008) | 3 lines
Remove our implementation of memmove() and strerror(); both are in the C89
standard library.
........
r61484 | brett.cannon | 2008-03-18 05:16:06 +0100 (Di, 18 Mär 2008) | 2 lines
The output directory for tests that compare against stdout is now gone!
........
r61488 | jeffrey.yasskin | 2008-03-18 05:29:35 +0100 (Di, 18 Mär 2008) | 2 lines
Block the "socket.ssl() is deprecated" warning from test_socket_ssl.
........
r61495 | jeffrey.yasskin | 2008-03-18 05:56:06 +0100 (Di, 18 Mär 2008) | 4 lines
Speed test_thread up from 51.328s to 0.081s by reducing its sleep times. We
still sleep at all to make it likely that all threads are active at the same
time.
........
r61496 | jeffrey.yasskin | 2008-03-18 06:12:41 +0100 (Di, 18 Mär 2008) | 4 lines
Speed up test_dict by about 10x by only checking selected dict literal sizes,
instead of every integer from 0 to 400. Exhaustive testing wastes time without
providing enough more assurance that the code is correct.
........
r61498 | neal.norwitz | 2008-03-18 06:20:29 +0100 (Di, 18 Mär 2008) | 1 line
Try increasing the timeout to reduce the flakiness of this test.
........
r61503 | brett.cannon | 2008-03-18 06:43:04 +0100 (Di, 18 Mär 2008) | 2 lines
Improve the error message for a test that failed on the S-390 Debian buildbot.
........
r61504 | jeffrey.yasskin | 2008-03-18 06:45:40 +0100 (Di, 18 Mär 2008) | 3 lines
Add a -S/--slow flag to regrtest to have it print the 10 slowest tests with
their times.
........
r61507 | neal.norwitz | 2008-03-18 07:03:46 +0100 (Di, 18 Mär 2008) | 1 line
Add some info to the failure messages
........
r61509 | trent.nelson | 2008-03-18 08:02:12 +0100 (Di, 18 Mär 2008) | 1 line
Issue 2286: bump up the stack size of the 64-bit debug python_d.exe to 2100000. The default value of 200000 causes a stack overflow at 1965 iterations of r_object() in marshal.c, 35 iterations before the 2000 limit enforced by MAX_MARSHAL_STACK_DEPTH.
........
r61510 | trent.nelson | 2008-03-18 08:32:47 +0100 (Di, 18 Mär 2008) | 5 lines
The behaviour of winsound.Beep() seems to differ between different versions of Windows when there's either:
a) no sound card entirely
b) legacy beep driver has been disabled
c) the legacy beep driver has been uninstalled
Sometimes RuntimeErrors are raised, sometimes they're not. If _have_soundcard() returns False, don't expect winsound.Beep() to raise a RuntimeError, as this clearly isn't the case, as demonstrated by the various Win32 XP buildbots.
........
r61515 | martin.v.loewis | 2008-03-18 13:20:15 +0100 (Di, 18 Mär 2008) | 2 lines
norwitz-amd64 (gentoo) has EREMOTEIO.
........
r61516 | martin.v.loewis | 2008-03-18 13:45:37 +0100 (Di, 18 Mär 2008) | 2 lines
Add more Linux error codes.
........
r61517 | martin.v.loewis | 2008-03-18 14:05:03 +0100 (Di, 18 Mär 2008) | 2 lines
Add WSA errors.
........
r61518 | martin.v.loewis | 2008-03-18 14:16:05 +0100 (Di, 18 Mär 2008) | 2 lines
Note that the stderr output of the test is intentional.
........
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Tue, 18 Mar 2008 15:15:01 +0000 |
| parents | 2750d531fdc0 |
| children | 47d9bbe10897 |
| 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 |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
7 /* Error objects */ |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
8 |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
9 /* PyException_HEAD defines the initial segment of every exception class. */ |
|
43109
eee5bdd37158
Fix a compile error on Windows.
Collin Winter <collinw@gmail.com>
parents:
43102
diff
changeset
|
10 #define PyException_HEAD PyObject_HEAD PyObject *dict;\ |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
11 PyObject *args; PyObject *traceback;\ |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
12 PyObject *context; PyObject *cause; |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
13 |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
14 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
15 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
16 } PyBaseExceptionObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
17 |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
18 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
19 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
20 PyObject *msg; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
21 PyObject *filename; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
22 PyObject *lineno; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
23 PyObject *offset; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
24 PyObject *text; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
25 PyObject *print_file_and_line; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
26 } PySyntaxErrorObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
27 |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
28 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
29 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
30 PyObject *encoding; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
31 PyObject *object; |
|
42110
e4f649c4f457
Merged revisions 55962-56019 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
42084
diff
changeset
|
32 Py_ssize_t start; |
|
e4f649c4f457
Merged revisions 55962-56019 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
42084
diff
changeset
|
33 Py_ssize_t end; |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
34 PyObject *reason; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
35 } PyUnicodeErrorObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
36 |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
37 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
38 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
39 PyObject *code; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
40 } PySystemExitObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
41 |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
42 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
43 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
44 PyObject *myerrno; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
45 PyObject *strerror; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
46 PyObject *filename; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
47 } PyEnvironmentErrorObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
48 |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
49 #ifdef MS_WINDOWS |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
50 typedef struct { |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
51 PyException_HEAD |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
52 PyObject *myerrno; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
53 PyObject *strerror; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
54 PyObject *filename; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
55 PyObject *winerror; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
56 } PyWindowsErrorObject; |
|
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
57 #endif |
| 145 | 58 |
| 6 | 59 /* Error handling definitions */ |
| 60 | |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
61 PyAPI_FUNC(void) PyErr_SetNone(PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
62 PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
63 PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
64 PyAPI_FUNC(PyObject *) PyErr_Occurred(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
65 PyAPI_FUNC(void) PyErr_Clear(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
66 PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
67 PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); |
| 6 | 68 |
|
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
|
69 #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
|
70 #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
|
71 #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
|
72 #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
|
73 #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
|
74 |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
75 /* Error testing and normalization */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
76 PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
77 PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
78 PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
79 |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
80 /* Traceback manipulation (PEP 3134) */ |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
81 PyAPI_FUNC(int) PyException_SetTraceback(PyObject *, PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
82 PyAPI_FUNC(PyObject *) PyException_GetTraceback(PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
83 |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
84 /* Cause manipulation (PEP 3134) */ |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
85 PyAPI_FUNC(PyObject *) PyException_GetCause(PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
86 PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
87 |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
88 /* Context manipulation (PEP 3134) */ |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
89 PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
90 PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *); |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
91 |
|
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
92 |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
93 /* */ |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
94 |
|
40909
f2f0b41f270d
Merged revisions 53875-53911 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
39610
diff
changeset
|
95 #define PyExceptionClass_Check(x) \ |
|
f2f0b41f270d
Merged revisions 53875-53911 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
39610
diff
changeset
|
96 (PyType_Check((x)) && \ |
|
f2f0b41f270d
Merged revisions 53875-53911 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
39610
diff
changeset
|
97 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
|
98 |
|
40909
f2f0b41f270d
Merged revisions 53875-53911 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
39610
diff
changeset
|
99 #define PyExceptionInstance_Check(x) \ |
|
f2f0b41f270d
Merged revisions 53875-53911 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
39610
diff
changeset
|
100 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
|
101 |
|
36988
49c6eb688906
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
Guido van Rossum <guido@python.org>
parents:
36751
diff
changeset
|
102 #define PyExceptionClass_Name(x) \ |
|
49c6eb688906
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
Guido van Rossum <guido@python.org>
parents:
36751
diff
changeset
|
103 ((char *)(((PyTypeObject*)(x))->tp_name)) |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
104 |
|
36988
49c6eb688906
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
Guido van Rossum <guido@python.org>
parents:
36751
diff
changeset
|
105 #define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type)) |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
106 |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
107 |
| 86 | 108 /* Predefined exceptions */ |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
109 |
|
36751
8e04de2480e4
PEP 352 implementation. Creates a new base class, BaseException, which has an
Brett Cannon <bcannon@gmail.com>
parents:
36501
diff
changeset
|
110 PyAPI_DATA(PyObject *) PyExc_BaseException; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
111 PyAPI_DATA(PyObject *) PyExc_Exception; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
112 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
|
113 PyAPI_DATA(PyObject *) PyExc_GeneratorExit; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
114 PyAPI_DATA(PyObject *) PyExc_ArithmeticError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
115 PyAPI_DATA(PyObject *) PyExc_LookupError; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
116 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
117 PyAPI_DATA(PyObject *) PyExc_AssertionError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
118 PyAPI_DATA(PyObject *) PyExc_AttributeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
119 PyAPI_DATA(PyObject *) PyExc_EOFError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
120 PyAPI_DATA(PyObject *) PyExc_FloatingPointError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
121 PyAPI_DATA(PyObject *) PyExc_EnvironmentError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
122 PyAPI_DATA(PyObject *) PyExc_IOError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
123 PyAPI_DATA(PyObject *) PyExc_OSError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
124 PyAPI_DATA(PyObject *) PyExc_ImportError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
125 PyAPI_DATA(PyObject *) PyExc_IndexError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
126 PyAPI_DATA(PyObject *) PyExc_KeyError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
127 PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
128 PyAPI_DATA(PyObject *) PyExc_MemoryError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
129 PyAPI_DATA(PyObject *) PyExc_NameError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
130 PyAPI_DATA(PyObject *) PyExc_OverflowError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
131 PyAPI_DATA(PyObject *) PyExc_RuntimeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
132 PyAPI_DATA(PyObject *) PyExc_NotImplementedError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
133 PyAPI_DATA(PyObject *) PyExc_SyntaxError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
134 PyAPI_DATA(PyObject *) PyExc_IndentationError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
135 PyAPI_DATA(PyObject *) PyExc_TabError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
136 PyAPI_DATA(PyObject *) PyExc_ReferenceError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
137 PyAPI_DATA(PyObject *) PyExc_SystemError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
138 PyAPI_DATA(PyObject *) PyExc_SystemExit; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
139 PyAPI_DATA(PyObject *) PyExc_TypeError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
140 PyAPI_DATA(PyObject *) PyExc_UnboundLocalError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
141 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
|
142 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
|
143 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
|
144 PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
145 PyAPI_DATA(PyObject *) PyExc_ValueError; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
146 PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; |
|
42665
85c22b4d4455
Merged in py3k-buffer branch to main line. All objects now use the buffer protocol in PEP 3118.
Travis E. Oliphant <oliphant@enthought.com>
parents:
42560
diff
changeset
|
147 PyAPI_DATA(PyObject *) PyExc_BufferError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
148 #ifdef MS_WINDOWS |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
149 PyAPI_DATA(PyObject *) PyExc_WindowsError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
150 #endif |
|
26550
b9c912e2c3c0
Patch #614055: Support OpenVMS.
Martin v. Löwis <martin@v.loewis.de>
parents:
26318
diff
changeset
|
151 #ifdef __VMS |
|
29726
85e52ec85629
Use appropriate macros not the deprecated DL_IMPORT/DL_EXPORT macros
Neal Norwitz <nnorwitz@gmail.com>
parents:
26601
diff
changeset
|
152 PyAPI_DATA(PyObject *) PyExc_VMSError; |
|
26550
b9c912e2c3c0
Patch #614055: Support OpenVMS.
Martin v. Löwis <martin@v.loewis.de>
parents:
26318
diff
changeset
|
153 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
154 |
|
45852
30c4e1ca8421
Merged revisions 61431,61433-61436,61439,61444,61449-61450,61453,61458,61465,61468,61471-61474,61480,61483-61484,61488,61495-61496,61498,61503-61504,61507,61509-61510,61515-61518 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44373
diff
changeset
|
155 PyAPI_DATA(PyObject *) PyExc_BufferError; |
|
30c4e1ca8421
Merged revisions 61431,61433-61436,61439,61444,61449-61450,61453,61458,61465,61468,61471-61474,61480,61483-61484,61488,61495-61496,61498,61503-61504,61507,61509-61510,61515-61518 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44373
diff
changeset
|
156 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
157 PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst; |
|
43292
876b7ef4775d
Merged revisions 57778-58052 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
43109
diff
changeset
|
158 PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
159 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
160 /* Predefined warning categories */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
161 PyAPI_DATA(PyObject *) PyExc_Warning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
162 PyAPI_DATA(PyObject *) PyExc_UserWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
163 PyAPI_DATA(PyObject *) PyExc_DeprecationWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
164 PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
165 PyAPI_DATA(PyObject *) PyExc_SyntaxWarning; |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
166 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
|
167 PyAPI_DATA(PyObject *) PyExc_FutureWarning; |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
36988
diff
changeset
|
168 PyAPI_DATA(PyObject *) PyExc_ImportWarning; |
|
39610
3674f20ac781
Merge current trunk into p3yk. This includes the PyNumber_Index API change,
Thomas Wouters <thomas@python.org>
parents:
39442
diff
changeset
|
169 PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; |
|
43777
0d462d789b18
Merging the py3k-pep3137 branch back into the py3k branch.
Guido van Rossum <guido@python.org>
parents:
43292
diff
changeset
|
170 PyAPI_DATA(PyObject *) PyExc_BytesWarning; |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
171 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
172 |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
173 /* Convenience functions */ |
|
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
174 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
175 PyAPI_FUNC(int) PyErr_BadArgument(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
176 PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
177 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
|
178 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
|
179 PyObject *, PyObject *); |
|
42794
84618b2064c1
Add const to some strings that are not modified
Neal Norwitz <nnorwitz@gmail.com>
parents:
42665
diff
changeset
|
180 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, 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
|
181 #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
|
182 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( |
|
42794
84618b2064c1
Add const to some strings that are not modified
Neal Norwitz <nnorwitz@gmail.com>
parents:
42665
diff
changeset
|
183 PyObject *, const Py_UNICODE *); |
|
25535
861065256487
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
25276
diff
changeset
|
184 #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
|
185 |
|
41878
089f449a20cd
Change PyErr_Format() to generate a unicode string (by using
Walter Dörwald <walter@livinglogic.de>
parents:
41749
diff
changeset
|
186 PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, 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
|
187 |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
188 #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
|
189 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
|
190 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
|
191 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
|
192 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
|
193 #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
|
194 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
|
195 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
|
196 #endif /* Py_WIN_WIDE_FILENAMES */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
197 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
|
198 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
|
199 PyObject *,int, PyObject *); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
200 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( |
|
24423
3db261a93a5b
New functions for extension writers on Windows:
Thomas Heller <theller@ctypes.org>
parents:
23564
diff
changeset
|
201 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
|
202 #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
|
203 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
|
204 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
|
205 #endif /* Py_WIN_WIDE_FILENAMES */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
206 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
|
207 #endif /* MS_WINDOWS */ |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
208 |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
209 /* 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
|
210 PyAPI_FUNC(void) PyErr_BadInternalCall(void); |
|
42794
84618b2064c1
Add const to some strings that are not modified
Neal Norwitz <nnorwitz@gmail.com>
parents:
42665
diff
changeset
|
211 PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno); |
|
14170
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
212 /* 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
|
213 Python 2.0: */ |
|
019265b3a856
Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents:
13435
diff
changeset
|
214 #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
215 |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
216 /* Function to create a new exception */ |
|
42794
84618b2064c1
Add const to some strings that are not modified
Neal Norwitz <nnorwitz@gmail.com>
parents:
42665
diff
changeset
|
217 PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base, |
|
13435
7e3cd9480f66
ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
218 PyObject *dict); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
219 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
|
220 |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
221 /* Issue a warning or exception */ |
|
39442
654c380cf8b9
Merged revisions 46753-51188 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
38453
diff
changeset
|
222 PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, |
|
654c380cf8b9
Merged revisions 46753-51188 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
38453
diff
changeset
|
223 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
|
224 PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42794
diff
changeset
|
225 const char *, int, |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
26550
diff
changeset
|
226 const char *, PyObject *); |
|
15589
857a5400be87
Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
227 |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
228 /* In sigcheck.c or signalmodule.c */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
229 PyAPI_FUNC(int) PyErr_CheckSignals(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
230 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
|
231 |
|
44373
2750d531fdc0
Merged revisions 59565-59594 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43777
diff
changeset
|
232 /* In signalmodule.c */ |
|
2750d531fdc0
Merged revisions 59565-59594 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43777
diff
changeset
|
233 int PySignal_SetWakeupFd(int fd); |
|
2750d531fdc0
Merged revisions 59565-59594 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43777
diff
changeset
|
234 |
|
16838
09f6c1372056
Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
15589
diff
changeset
|
235 /* 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
|
236 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
|
237 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
|
238 |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
239 /* 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
|
240 exceptions from C */ |
|
26318
910fa739f4a4
Fix PEP 293 related problems with --disable-unicode builds
Walter Dörwald <walter@livinglogic.de>
parents:
25535
diff
changeset
|
241 |
|
25091
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
242 /* 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
|
243 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
244 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
|
245 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
246 /* 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
|
247 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
248 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
|
249 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
250 /* 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
|
251 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
35316
diff
changeset
|
252 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
|
253 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
254 /* 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
|
255 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
|
256 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
|
257 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
258 /* 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
|
259 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
|
260 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
|
261 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
|
262 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
263 /* 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
|
264 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
|
265 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
|
266 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
|
267 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
|
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 /* 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
|
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_SetStart(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_SetStart(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_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
|
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 /* 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
|
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_GetEnd(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_GetEnd(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_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
|
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 /* 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
|
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_SetEnd(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_SetEnd(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_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
|
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 /* 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
|
288 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
|
289 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
|
290 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
|
291 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
292 /* 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
|
293 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
|
294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 |
|
0337dad8403e
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Walter Dörwald <walter@livinglogic.de>
parents:
24818
diff
changeset
|
301 |
|
18908
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
302 /* 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 be reliable. |
|
ba67b9c97b69
Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents:
20626
diff
changeset
|
309 */ |
|
18908
79c676f9b34a
This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents:
17597
diff
changeset
|
310 #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
|
311 # 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
|
312 # 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
|
313 # 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
|
314 #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
|
315 |
|
18909
9753b0269f3a
va_list is defined in stdarg.h.
Marc-André Lemburg <mal@egenix.com>
parents:
18908
diff
changeset
|
316 #include <stdarg.h> |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
317 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
|
318 Py_GCC_ATTRIBUTE((format(printf, 3, 4))); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24423
diff
changeset
|
319 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
|
320 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
|
321 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
322 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
323 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
324 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
325 #endif /* !Py_ERRORS_H */ |
