summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-26 09:31:11 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-26 09:31:11 (GMT)
commitdee3f65d986de6ac7ec1e4b5292ef18ec14fc9f7 (patch)
tree0c2212d3e6fc887c270439f4359d396e3c8918b4 /Python
parentd3757233659f85b5ddecb286341c34b75b711645 (diff)
downloadcpython-dee3f65d986de6ac7ec1e4b5292ef18ec14fc9f7.zip
cpython-dee3f65d986de6ac7ec1e4b5292ef18ec14fc9f7.tar.gz
cpython-dee3f65d986de6ac7ec1e4b5292ef18ec14fc9f7.tar.bz2
Revert PySet_Add() changes.
Diffstat (limited to 'Python')
-rw-r--r--Python/marshal.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 1b88ff9..0c611b6 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -860,7 +860,7 @@ r_object(RFILE *p)
retval = NULL;
break;
}
- v = (type == TYPE_SET) ? PySet_New(NULL) : PyFrozenSet_New(NULL);
+ v = PyTuple_New((int)n);
if (v == NULL) {
retval = NULL;
break;
@@ -875,14 +875,18 @@ r_object(RFILE *p)
v = NULL;
break;
}
- if (PySet_Add(v, v2) == -1) {
- Py_DECREF(v);
- Py_DECREF(v2);
- v = NULL;
- break;
- }
+ PyTuple_SET_ITEM(v, (int)i, v2);
}
- retval = (v == NULL) ? NULL : v;
+ if (v == NULL) {
+ retval = NULL;
+ break;
+ }
+ if (type == TYPE_SET)
+ v3 = PySet_New(v);
+ else
+ v3 = PyFrozenSet_New(v);
+ Py_DECREF(v);
+ retval = v3;
break;
case TYPE_CODE: