2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

fix map_indexing_suite test case

[SVN r54868]
This commit is contained in:
Haoyu Bai
2009-07-10 17:36:07 +00:00
parent f1ee4a4b86
commit 5e68c24f10
2 changed files with 9 additions and 1 deletions

View File

@@ -48,7 +48,11 @@ struct AFromPython
static void* convertible(PyObject* obj_ptr)
{
#if PY_VERSION_HEX >= 0x03000000
if (!PyLong_Check(obj_ptr)) return 0;
#else
if (!PyInt_Check(obj_ptr)) return 0;
#endif
return obj_ptr;
}
@@ -60,7 +64,11 @@ struct AFromPython
(boost::python::converter::rvalue_from_python_storage< A >*)
data)-> storage.bytes;
#if PY_VERSION_HEX >= 0x03000000
new (storage) A((int)PyLong_AsLong(obj_ptr));
#else
new (storage) A((int)PyInt_AsLong(obj_ptr));
#endif
data->convertible = storage;
}
};

View File

@@ -197,7 +197,7 @@ kiwi
>>> tm["kimpo"] = X("bbb")
>>> print_xmap(tm)
[ (joel, aaa) (kimpo, bbb) ]
>>> for el in tm:
>>> for el in tm: #doctest: +NORMALIZE_WHITESPACE
... print el.key(),
... dom = el.data()
joel kimpo