mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 16:52:15 +00:00
Merged 2009 GSoC work from sandbox-branches/bhy/py3k branch back into trunk.
[SVN r56305]
This commit is contained in:
@@ -59,7 +59,13 @@ void eval_test()
|
||||
void exec_test()
|
||||
{
|
||||
// Register the module with the interpreter
|
||||
if (PyImport_AppendInittab(const_cast<char*>("embedded_hello"), initembedded_hello) == -1)
|
||||
if (PyImport_AppendInittab(const_cast<char*>("embedded_hello"),
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
PyInit_embedded_hello
|
||||
#else
|
||||
initembedded_hello
|
||||
#endif
|
||||
) == -1)
|
||||
throw std::runtime_error("Failed to add embedded_hello to the interpreter's "
|
||||
"builtin modules");
|
||||
// Retrieve the main module
|
||||
@@ -105,7 +111,7 @@ void exec_test_error()
|
||||
{
|
||||
// Execute a statement that raises a python exception.
|
||||
python::dict global;
|
||||
python::object result = python::exec("print unknown \n", global, global);
|
||||
python::object result = python::exec("print(unknown) \n", global, global);
|
||||
}
|
||||
|
||||
void exercise_embedding_html()
|
||||
|
||||
Reference in New Issue
Block a user