diff --git a/src/object/function.cpp b/src/object/function.cpp index 76a9df51..a90591d2 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -24,7 +24,9 @@ #include #include -#include +#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES +# include +#endif namespace boost { namespace python { namespace objects { @@ -224,7 +226,9 @@ void function::argument_error(PyObject* args, PyObject* keywords) const message += str("\n ").join(signatures); - printf("\n--------\n%s\n--------\n", extract(message)()); +#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES + std::printf("\n--------\n%s\n--------\n", extract(message)()); +#endif PyErr_SetObject(exception.get(), message.ptr()); throw_error_already_set(); }