diff options
| author | alexv-smirnov <[email protected]> | 2023-03-15 19:59:12 +0300 |
|---|---|---|
| committer | alexv-smirnov <[email protected]> | 2023-03-15 19:59:12 +0300 |
| commit | 056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 (patch) | |
| tree | 4740980126f32e3af7937ba0ca5f83e59baa4ab0 /contrib/restricted/boost/python/src/import.cpp | |
| parent | 269126dcced1cc8b53eb4398b4a33e5142f10290 (diff) | |
add library/cpp/actors, ymake build to ydb oss export
Diffstat (limited to 'contrib/restricted/boost/python/src/import.cpp')
| -rw-r--r-- | contrib/restricted/boost/python/src/import.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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 <boost/python/import.hpp> +#include <boost/python/borrowed.hpp> +#include <boost/python/extract.hpp> +#include <boost/python/handle.hpp> + +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<char *>(name); + python::handle<> module(PyImport_ImportModule(n)); + return python::object(module); +} + +} // namespace boost::python +} // namespace boost |
