+ Fix broken unit tests

This commit is contained in:
wmayer
2014-02-25 15:20:33 +01:00
parent 4b0b483892
commit f0d8650c3c
8 changed files with 28 additions and 20 deletions

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
# include <boost/version.hpp>
# include <boost/filesystem/path.hpp>
#endif
@@ -478,10 +479,14 @@ void PropertyEnumeration::setPyObject(PyObject *value)
}
else if (PyString_Check(value)) {
const char* str = PyString_AsString (value);
if (_EnumArray && isPartOf(str))
if (_EnumArray && isPartOf(str)) {
setValue(PyString_AsString (value));
else
throw Base::ValueError("not part of the enum");
}
else {
std::stringstream out;
out << "'" << str << "' is not part of the enumeration";
throw Base::ValueError(out.str());
}
}
else if (PyList_Check(value)) {
Py_ssize_t nSize = PyList_Size(value);