summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-08-25 04:06:59 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-08-25 04:06:59 -0300
commit838b56730d27a6fd5e229c103f1d9957c58c5b0d (patch)
treed7b2732702935baeddecf923c360b0e1d8588320
parent9d58de1bfc7e93606fb5582dd05eea185e9fe851 (diff)
changed pair_conversion.h to use PySequence functions instead of
PyTuple ones, also fixed pair_test.py
-rw-r--r--tests/samplebinding/pair_conversions.h4
-rwxr-xr-xtests/samplebinding/pair_test.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/samplebinding/pair_conversions.h b/tests/samplebinding/pair_conversions.h
index 8adf2f6f..b1df3c5f 100644
--- a/tests/samplebinding/pair_conversions.h
+++ b/tests/samplebinding/pair_conversions.h
@@ -13,8 +13,8 @@ struct Converter_std_pair
static StdPair toCpp(PyObject* pyobj)
{
StdPair result;
- PyObject* pyFirst = PyTuple_GET_ITEM(pyobj, 0);
- PyObject* pySecond = PyTuple_GET_ITEM(pyobj, 1);
+ PyObject* pyFirst = PySequence_GetItem(pyobj, 0);
+ PyObject* pySecond = PySequence_GetItem(pyobj, 1);
result.first = Converter<typename StdPair::first_type>::toCpp(pyFirst);
result.second = Converter<typename StdPair::second_type>::toCpp(pySecond);
return result;
diff --git a/tests/samplebinding/pair_test.py b/tests/samplebinding/pair_test.py
index 212fabfc..fd82dde3 100755
--- a/tests/samplebinding/pair_test.py
+++ b/tests/samplebinding/pair_test.py
@@ -69,7 +69,7 @@ class PairConversionTest(unittest.TestCase):
pu.setPair(pair)
result = pu.getPair()
self.assertNotEqual(result, pair)
- self.assertEqual(result, list(pair))
+ self.assertEqual(result, tuple(pair))
if __name__ == '__main__':
unittest.main()