Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54645 - sandbox-branches/bhy/py3k/libs/python/test
From: divinekid_at_[hidden]
Date: 2009-07-04 12:18:24


Author: bhy
Date: 2009-07-04 12:18:24 EDT (Sat, 04 Jul 2009)
New Revision: 54645
URL: http://svn.boost.org/trac/boost/changeset/54645

Log:
fix the 'try' test case
Text files modified:
   sandbox-branches/bhy/py3k/libs/python/test/m1.cpp | 6 ++----
   sandbox-branches/bhy/py3k/libs/python/test/m2.cpp | 10 ++++++++++
   2 files changed, 12 insertions(+), 4 deletions(-)

Modified: sandbox-branches/bhy/py3k/libs/python/test/m1.cpp
==============================================================================
--- sandbox-branches/bhy/py3k/libs/python/test/m1.cpp (original)
+++ sandbox-branches/bhy/py3k/libs/python/test/m1.cpp 2009-07-04 12:18:24 EDT (Sat, 04 Jul 2009)
@@ -32,8 +32,7 @@
 };
 
 PyTypeObject NoddyType = {
- PyObject_HEAD_INIT(NULL)
- 0,
+ PyVarObject_HEAD_INIT(NULL, 0)
     const_cast<char*>("Noddy"),
     sizeof(NoddyObject),
     0,
@@ -104,8 +103,7 @@
 };
 
 PyTypeObject SimpleType = {
- PyObject_HEAD_INIT(NULL)
- 0,
+ PyVarObject_HEAD_INIT(NULL, 0)
     const_cast<char*>("Simple"),
     sizeof(SimpleObject),
     0,

Modified: sandbox-branches/bhy/py3k/libs/python/test/m2.cpp
==============================================================================
--- sandbox-branches/bhy/py3k/libs/python/test/m2.cpp (original)
+++ sandbox-branches/bhy/py3k/libs/python/test/m2.cpp 2009-07-04 12:18:24 EDT (Sat, 04 Jul 2009)
@@ -13,6 +13,11 @@
 #include <boost/python/return_value_policy.hpp>
 #include "simple_type.hpp"
 
+#if PY_VERSION_HEX >= 0x03000000
+# define PyString_FromString PyUnicode_FromString
+# define PyInt_FromLong PyLong_FromLong
+#endif
+
 // Get a simple (by value) from the argument, and return the
 // string it holds.
 PyObject* unwrap_simple(simple x)
@@ -52,6 +57,11 @@
     return PyInt_FromLong(x);
 }
 
+#if PY_VERSION_HEX >= 0x03000000
+# undef PyString_FromString
+# undef PyInt_FromLong
+#endif
+
 // rewrap<T> extracts a T from the argument, then converts the T back
 // to a PyObject* and returns it.
 template <class T>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk