Update of /cvsroot/boost/boost/libs/python/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2983/libs/python/src
Modified Files:
Tag: RC_1_34_0
exec.cpp
Log Message:
Backport new eval() function from HEAD.
Index: exec.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/python/src/exec.cpp,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- exec.cpp 27 Oct 2006 21:19:47 -0000 1.1.4.2
+++ exec.cpp 15 May 2007 13:43:52 -0000 1.1.4.3
@@ -13,6 +13,15 @@
namespace python
{
+object BOOST_PYTHON_DECL eval(str string, object global, object local)
+{
+ // should be 'char const *' but older python versions don't use 'const' yet.
+ char *s = python::extract<char *>(string);
+ PyObject* result = PyRun_String(s, Py_eval_input, global.ptr(), local.ptr());
+ if (!result) throw_error_already_set();
+ return object(detail::new_reference(result));
+}
+
object BOOST_PYTHON_DECL exec(str string, object global, object local)
{
// should be 'char const *' but older python versions don't use 'const' yet.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs