aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-02-11 18:18:14 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:58 -0300
commit719b8f40e337edf57c6993c725ab5e71e329bc58 (patch)
tree0a644a69d05355d0ff14e82acf31e36e402f2e69 /libpyside
parent03f4a7b08397045ab321d9ef6dd7ed2bf408b009 (diff)
Raise error when slot argument is unknown.
Instead of accepting it silently and generating potential segfault and undefined behavior, raise TypeError when the type of an argument is unknown to PySide type system. An example of such erratic behavior is in declarations like: @Slot def foo(self): Slots without arguments must be explicitly declared this way: @Slot() def foo(self): Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Hugo Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/pysideslot.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpyside/pysideslot.cpp b/libpyside/pysideslot.cpp
index 7d22ca9b0..28c6ed6a3 100644
--- a/libpyside/pysideslot.cpp
+++ b/libpyside/pysideslot.cpp
@@ -121,6 +121,9 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw)
} else {
data->args = typeName;
}
+ } else {
+ PyErr_Format(PyExc_TypeError, "Unknown signal argument type: %s", argType->ob_type->tp_name);
+ return -1;
}
}