X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=bindings%2Fpython%2Fpython-complements.c;h=52465aa229a83495ea2c46cba7d4be5559291042;hp=6f947bd04e331cb3675a3820b8166e6e2af18e5f;hb=9132dc67804f7e868c21f759bf739ace4ce069b6;hpb=0e1b84aa80398d5573b73ae4d6ae79d6a930a2fd diff --git a/bindings/python/python-complements.c b/bindings/python/python-complements.c index 6f947bd0..52465aa2 100644 --- a/bindings/python/python-complements.c +++ b/bindings/python/python-complements.c @@ -21,6 +21,8 @@ #include "python-complements.h" #include #include +#include +#include /* FILE functions ---------------------------------------------------- @@ -236,3 +238,14 @@ enum ctf_type_id _bt_python_get_field_type(const struct bt_ctf_field *field) end: return type_id; } + +/* + * Python 3.5 changes the StopIteration exception clearing behaviour which + * erroneously marks swig clean-up function as having failed. This explicit + * allocation function is intended as a work-around so SWIG doesn't manage + * the lifetime of a "temporary" object by itself. + */ +struct bt_iter_pos *_bt_python_create_iter_pos(void) +{ + return g_new0(struct bt_iter_pos, 1); +}