Mercurial > cpython-lru_cache-weakref
annotate Modules/_sqlite/sqlitecompat.h @ 58973:db86bf39ccaa legacy-trunk
Issue 7970: When email.Parser.Parser parses a MIME message of type
message/rfc822 it turns it into an object whose body consists of
a list containing a single Message object. HeaderParser, on the
other hand, just copies the body as a string. Generator.flatten
has a special handler for the message mime type that expected the
body to be the one item list. This fails if the message was parsed
by HeaderParser. So we now check to see if the body is a string
first, and if so just we just emit it.
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Sun, 21 Feb 2010 04:23:00 +0000 |
| parents | d27058c409df |
| children | 04d3ae52ff73 |
| rev | line source |
|---|---|
|
37458
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
1 /* sqlitecompat.h - compatibility macros |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
2 * |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2006 Gerhard Häring <gh@ghaering.de> |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
4 * |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
5 * This file is part of pysqlite. |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
6 * |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
7 * This software is provided 'as-is', without any express or implied |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
8 * warranty. In no event will the authors be held liable for any damages |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
9 * arising from the use of this software. |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
10 * |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
11 * Permission is granted to anyone to use this software for any purpose, |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
12 * including commercial applications, and to alter it and redistribute it |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
13 * freely, subject to the following restrictions: |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
14 * |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
15 * 1. The origin of this software must not be misrepresented; you must not |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
16 * claim that you wrote the original software. If you use this software |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
17 * in a product, an acknowledgment in the product documentation would be |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
18 * appreciated but is not required. |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
19 * 2. Altered source versions must be plainly marked as such, and must not be |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
20 * misrepresented as being the original software. |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
21 * 3. This notice may not be removed or altered from any source distribution. |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
22 */ |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
23 |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
24 #ifndef PYSQLITE_COMPAT_H |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
25 #define PYSQLITE_COMPAT_H |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
26 |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
27 /* define Py_ssize_t for pre-2.5 versions of Python */ |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
28 |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
29 #if PY_VERSION_HEX < 0x02050000 |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
30 typedef int Py_ssize_t; |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
31 typedef int (*lenfunc)(PyObject*); |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
32 #endif |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
33 |
|
d27058c409df
Update to pysqlite 2.2.0
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
34 #endif |
