summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-11-10 23:39:45 (GMT)
committerGuido van Rossum <guido@python.org>2007-11-10 23:39:45 (GMT)
commit58da931da9f9e75d36c364895e95a8cf015fa159 (patch)
treeae47e868c67275c5c21d502334fa0cce803b63f4 /Python/marshal.c
parent06cfe95237bd92f0b2d1ef1eebc892ae74063809 (diff)
downloadcpython-58da931da9f9e75d36c364895e95a8cf015fa159.zip
cpython-58da931da9f9e75d36c364895e95a8cf015fa159.tar.gz
cpython-58da931da9f9e75d36c364895e95a8cf015fa159.tar.bz2
Merged revisions 58886-58929 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r58892 | guido.van.rossum | 2007-11-06 15:32:56 -0800 (Tue, 06 Nov 2007) | 2 lines Add missing "return NULL" in overflow check in PyObject_Repr(). ........ r58893 | raymond.hettinger | 2007-11-06 17:13:09 -0800 (Tue, 06 Nov 2007) | 1 line Fix marshal's incorrect handling of subclasses of builtin types (backport candidate). ........ r58895 | raymond.hettinger | 2007-11-06 18:26:17 -0800 (Tue, 06 Nov 2007) | 1 line Optimize dict.fromkeys() with dict inputs. Useful for resetting bag/muliset counts for example. ........ r58896 | raymond.hettinger | 2007-11-06 18:45:46 -0800 (Tue, 06 Nov 2007) | 1 line Add build option for faster loop execution. ........ r58900 | nick.coghlan | 2007-11-07 03:57:51 -0800 (Wed, 07 Nov 2007) | 1 line Add missing NEWS entry ........ r58905 | christian.heimes | 2007-11-07 09:50:54 -0800 (Wed, 07 Nov 2007) | 1 line Backported fix for bug #1392 from py3k branch r58903. ........ r58906 | christian.heimes | 2007-11-07 10:30:22 -0800 (Wed, 07 Nov 2007) | 1 line Backport of Guido's review of my patch. ........ r58908 | raymond.hettinger | 2007-11-07 18:52:43 -0800 (Wed, 07 Nov 2007) | 1 line Add set.isdisjoint() ........ r58915 | raymond.hettinger | 2007-11-08 10:47:51 -0800 (Thu, 08 Nov 2007) | 1 line Reposition the decref (spotted by eagle-eye norwitz). ........ r58920 | georg.brandl | 2007-11-09 04:31:43 -0800 (Fri, 09 Nov 2007) | 2 lines Fix seealso link to sets docs. Do not merge to Py3k. ........ r58921 | georg.brandl | 2007-11-09 05:08:48 -0800 (Fri, 09 Nov 2007) | 2 lines Fix misleading example. ........ r58923 | georg.brandl | 2007-11-09 09:33:23 -0800 (Fri, 09 Nov 2007) | 3 lines Correct a comment about testing methods - nowadays most tests don't run directly on import. ........ r58924 | martin.v.loewis | 2007-11-09 14:56:30 -0800 (Fri, 09 Nov 2007) | 2 lines Add Amaury Forgeot d'Arc. ........ r58925 | raymond.hettinger | 2007-11-09 15:14:44 -0800 (Fri, 09 Nov 2007) | 1 line Optimize common case for dict.fromkeys(). ........ r58927 | raymond.hettinger | 2007-11-09 17:54:03 -0800 (Fri, 09 Nov 2007) | 1 line Use a freelist to speed-up block allocation and deallocation in collections.deque(). ........ r58929 | guido.van.rossum | 2007-11-10 14:12:24 -0800 (Sat, 10 Nov 2007) | 3 lines Issue 1416. Add getter, setter, deleter methods to properties that can be used as decorators to create fully-populated properties. ........
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index a40aecc..3e106c2 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -147,7 +147,7 @@ w_object(PyObject *v, WFILE *p)
else if (v == Py_True) {
w_byte(TYPE_TRUE, p);
}
- else if (PyLong_Check(v)) {
+ else if (PyLong_CheckExact(v)) {
long x = PyLong_AsLong(v);
if ((x == -1) && PyErr_Occurred()) {
PyLongObject *ob = (PyLongObject *)v;
@@ -175,7 +175,7 @@ w_object(PyObject *v, WFILE *p)
}
}
}
- else if (PyFloat_Check(v)) {
+ else if (PyFloat_CheckExact(v)) {
if (p->version > 1) {
unsigned char buf[8];
if (_PyFloat_Pack8(PyFloat_AsDouble(v),
@@ -196,7 +196,7 @@ w_object(PyObject *v, WFILE *p)
}
}
#ifndef WITHOUT_COMPLEX
- else if (PyComplex_Check(v)) {
+ else if (PyComplex_CheckExact(v)) {
if (p->version > 1) {
unsigned char buf[8];
if (_PyFloat_Pack8(PyComplex_RealAsDouble(v),
@@ -228,7 +228,7 @@ w_object(PyObject *v, WFILE *p)
}
}
#endif
- else if (PyString_Check(v)) {
+ else if (PyString_CheckExact(v)) {
w_byte(TYPE_STRING, p);
n = PyString_GET_SIZE(v);
if (n > INT_MAX) {
@@ -240,7 +240,7 @@ w_object(PyObject *v, WFILE *p)
w_long((long)n, p);
w_string(PyString_AS_STRING(v), (int)n, p);
}
- else if (PyUnicode_Check(v)) {
+ else if (PyUnicode_CheckExact(v)) {
PyObject *utf8;
utf8 = PyUnicode_AsUTF8String(v);
if (utf8 == NULL) {
@@ -259,7 +259,7 @@ w_object(PyObject *v, WFILE *p)
w_string(PyString_AS_STRING(utf8), (int)n, p);
Py_DECREF(utf8);
}
- else if (PyTuple_Check(v)) {
+ else if (PyTuple_CheckExact(v)) {
w_byte(TYPE_TUPLE, p);
n = PyTuple_Size(v);
w_long((long)n, p);
@@ -267,7 +267,7 @@ w_object(PyObject *v, WFILE *p)
w_object(PyTuple_GET_ITEM(v, i), p);
}
}
- else if (PyList_Check(v)) {
+ else if (PyList_CheckExact(v)) {
w_byte(TYPE_LIST, p);
n = PyList_GET_SIZE(v);
w_long((long)n, p);
@@ -275,7 +275,7 @@ w_object(PyObject *v, WFILE *p)
w_object(PyList_GET_ITEM(v, i), p);
}
}
- else if (PyDict_Check(v)) {
+ else if (PyDict_CheckExact(v)) {
Py_ssize_t pos;
PyObject *key, *value;
w_byte(TYPE_DICT, p);
@@ -287,7 +287,7 @@ w_object(PyObject *v, WFILE *p)
}
w_object((PyObject *)NULL, p);
}
- else if (PyAnySet_Check(v)) {
+ else if (PyAnySet_CheckExact(v)) {
PyObject *value, *it;
if (PyObject_TypeCheck(v, &PySet_Type))