From 056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 Mon Sep 17 00:00:00 2001 From: alexv-smirnov Date: Wed, 15 Mar 2023 19:59:12 +0300 Subject: add library/cpp/actors, ymake build to ydb oss export --- contrib/restricted/boost/python/src/import.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contrib/restricted/boost/python/src/import.cpp (limited to 'contrib/restricted/boost/python/src/import.cpp') diff --git a/contrib/restricted/boost/python/src/import.cpp b/contrib/restricted/boost/python/src/import.cpp new file mode 100644 index 00000000000..0add79eea25 --- /dev/null +++ b/contrib/restricted/boost/python/src/import.cpp @@ -0,0 +1,25 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +namespace boost +{ +namespace python +{ + +object BOOST_PYTHON_DECL import(str name) +{ + // should be 'char const *' but older python versions don't use 'const' yet. + char *n = python::extract(name); + python::handle<> module(PyImport_ImportModule(n)); + return python::object(module); +} + +} // namespace boost::python +} // namespace boost -- cgit v1.3