mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Merged revisions 55228 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r55228 | guido.van.rossum | 2007-05-10 10:25:43 -0700 (Thu, 10 May 2007) | 9 lines Merged revisions 55227 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r55227 | guido.van.rossum | 2007-05-10 10:20:15 -0700 (Thu, 10 May 2007) | 2 lines Fix a bug in test_c_api() that caused a negative refcount. ........ ................
This commit is contained in:
parent
c3ab0a75d1
commit
3b116a3187
1 changed files with 3 additions and 3 deletions
|
@ -2222,7 +2222,7 @@ test_c_api(PySetObject *so)
|
||||||
Py_ssize_t count;
|
Py_ssize_t count;
|
||||||
char *s;
|
char *s;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
PyObject *elem, *dup, *t, *f, *dup2;
|
PyObject *elem=NULL, *dup=NULL, *t, *f, *dup2, *x;
|
||||||
PyObject *ob = (PyObject *)so;
|
PyObject *ob = (PyObject *)so;
|
||||||
|
|
||||||
/* Verify preconditions and exercise type/size checks */
|
/* Verify preconditions and exercise type/size checks */
|
||||||
|
@ -2268,8 +2268,8 @@ test_c_api(PySetObject *so)
|
||||||
|
|
||||||
/* Exercise direct iteration */
|
/* Exercise direct iteration */
|
||||||
i = 0, count = 0;
|
i = 0, count = 0;
|
||||||
while (_PySet_Next((PyObject *)dup, &i, &elem)) {
|
while (_PySet_Next((PyObject *)dup, &i, &x)) {
|
||||||
s = PyString_AsString(elem);
|
s = PyString_AsString(x);
|
||||||
assert(s && (s[0] == 'a' || s[0] == 'b' || s[0] == 'c'));
|
assert(s && (s[0] == 'a' || s[0] == 'b' || s[0] == 'c'));
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue