nicer type_caster::load() calling conventions

This commit is contained in:
Wenzel Jakob
2016-05-10 15:59:01 +01:00
parent 5984baafd0
commit 178c8a899d
12 changed files with 213 additions and 71 deletions

View File

@@ -26,6 +26,8 @@ NAMESPACE_BEGIN(detail)
template <typename T> class type_caster<std::complex<T>> {
public:
bool load(handle src, bool) {
if (!src)
return false;
Py_complex result = PyComplex_AsCComplex(src.ptr());
if (result.real == -1.0 && PyErr_Occurred()) {
PyErr_Clear();