diff options
| author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
|---|---|---|
| committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
| commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
| tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/tools/cython/Cython/Utility/CppSupport.cpp | |
| parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
fix ya.make
Diffstat (limited to 'contrib/tools/cython/Cython/Utility/CppSupport.cpp')
| -rw-r--r-- | contrib/tools/cython/Cython/Utility/CppSupport.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/contrib/tools/cython/Cython/Utility/CppSupport.cpp b/contrib/tools/cython/Cython/Utility/CppSupport.cpp deleted file mode 100644 index b8fcff06436..00000000000 --- a/contrib/tools/cython/Cython/Utility/CppSupport.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/////////////// CppExceptionConversion.proto /////////////// - -#ifndef __Pyx_CppExn2PyErr -#include <new> -#include <typeinfo> -#include <stdexcept> -#include <ios> - -static void __Pyx_CppExn2PyErr() { - // Catch a handful of different errors here and turn them into the - // equivalent Python errors. - try { - if (PyErr_Occurred()) - ; // let the latest Python exn pass through and ignore the current one - else - throw; - } catch (const std::bad_alloc& exn) { - PyErr_SetString(PyExc_MemoryError, exn.what()); - } catch (const std::bad_cast& exn) { - PyErr_SetString(PyExc_TypeError, exn.what()); - } catch (const std::bad_typeid& exn) { - PyErr_SetString(PyExc_TypeError, exn.what()); - } catch (const std::domain_error& exn) { - PyErr_SetString(PyExc_ValueError, exn.what()); - } catch (const std::invalid_argument& exn) { - PyErr_SetString(PyExc_ValueError, exn.what()); - } catch (const std::ios_base::failure& exn) { - // Unfortunately, in standard C++ we have no way of distinguishing EOF - // from other errors here; be careful with the exception mask - PyErr_SetString(PyExc_IOError, exn.what()); - } catch (const std::out_of_range& exn) { - // Change out_of_range to IndexError - PyErr_SetString(PyExc_IndexError, exn.what()); - } catch (const std::overflow_error& exn) { - PyErr_SetString(PyExc_OverflowError, exn.what()); - } catch (const std::range_error& exn) { - PyErr_SetString(PyExc_ArithmeticError, exn.what()); - } catch (const std::underflow_error& exn) { - PyErr_SetString(PyExc_ArithmeticError, exn.what()); - } catch (const std::exception& exn) { - PyErr_SetString(PyExc_RuntimeError, exn.what()); - } - catch (...) - { - PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); - } -} -#endif - -/////////////// PythranConversion.proto /////////////// - -template <class T> -auto __Pyx_pythran_to_python(T &&value) -> decltype(to_python( - typename pythonic::returnable<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::type{std::forward<T>(value)})) -{ - using returnable_type = typename pythonic::returnable<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::type; - return to_python(returnable_type{std::forward<T>(value)}); -} |
