Commit 5c83d4d9 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

python: fix invalid return value for Node::setInitialVoltage()

Former-commit-id: e184629e
parent d78bce04
......@@ -53,7 +53,7 @@ namespace Python {
static PyObject* voltage(PyObject *self, PyObject *args);
static PyObject* gnd(PyObject *self, PyObject *args);
static void setInitialVoltage(PyObject *self, PyObject *args, PyObject *kwds);
static PyObject* setInitialVoltage(PyObject *self, PyObject *args, PyObject *kwds);
static const char *name;
static const char *doc;
......@@ -163,7 +163,7 @@ const char* Python::Node<VarType>::docSetInitialVoltage =
"Set the initial voltage at this node.\n";
template<typename VarType>
void Python::Node<VarType>::setInitialVoltage(PyObject *self, PyObject *args, PyObject *kwds) {
PyObject* Python::Node<VarType>::setInitialVoltage(PyObject *self, PyObject *args, PyObject *kwds) {
Py_complex initVoltage;
CPS::Int phaseIndex;
......@@ -171,10 +171,12 @@ void Python::Node<VarType>::setInitialVoltage(PyObject *self, PyObject *args, Py
static const char *kwlist[] = {"voltage", "index", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "Di", (char **) kwlist, &initVoltage, &phaseIndex))
Python::Node<VarType>* pyNode = (Python::Node<VarType>*) self;
pyNode->node->setInitialVoltage(CPS::Complex(initVoltage.real,initVoltage.imag), phaseIndex);
template<typename VarType>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment