[Python-checkins] python/dist/src/Mac/Modules/cf pycfbridge.c,1.2,1.3
jackjansen@sourceforge.net
jackjansen@sourceforge.net
Wed, 08 May 2002 08:29:35 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/cf
In directory usw-pr-cvs1:/tmp/cvs-serv597
Modified Files:
pycfbridge.c
Log Message:
Partial fix for string handling. Null byte TBD.
Index: pycfbridge.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/pycfbridge.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pycfbridge.c 7 May 2002 23:00:03 -0000 1.2
--- pycfbridge.c 8 May 2002 15:29:33 -0000 1.3
***************
*** 54,58 ****
item_py = PyCF_CF2Python(item_cf);
if (item_py == NULL ) goto err;
! if (!PyList_SetItem(rv, i, item_py)) goto err;
item_py = NULL;
}
--- 54,58 ----
item_py = PyCF_CF2Python(item_cf);
if (item_py == NULL ) goto err;
! if (PyList_SetItem(rv, i, item_py) < 0) goto err;
item_py = NULL;
}
***************
*** 87,91 ****
value_py = PyCF_CF2Python(value_py);
if (value_py == NULL ) goto err;
! if (!PyDict_SetItem(rv, key_py, value_py)) goto err;
key_py = NULL;
value_py = NULL;
--- 87,91 ----
value_py = PyCF_CF2Python(value_py);
if (value_py == NULL ) goto err;
! if (PyDict_SetItem(rv, key_py, value_py) < 0) goto err;
key_py = NULL;
value_py = NULL;
***************
*** 136,139 ****
--- 136,141 ----
PyCF_Python2CF(PyObject *src, CFTypeRef *dst) {
+ if (PyString_Check(src) || PyUnicode_Check(src))
+ return PyCF_Python2CF_simple(src, dst);
if (PySequence_Check(src))
return PyCF_Python2CF_sequence(src, (CFArrayRef *)dst);