From daff201ffbee62eee418c99ea56c148cbf90614a Mon Sep 17 00:00:00 2001 From: c-holtermann Date: Thu, 2 Apr 2020 23:41:35 +0200 Subject: [PATCH] don't allow instance=None for wrapper objects --- bindings/python/function_class.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bindings/python/function_class.py b/bindings/python/function_class.py index 7349723826..81bebb049e 100644 --- a/bindings/python/function_class.py +++ b/bindings/python/function_class.py @@ -59,12 +59,15 @@ class ClassFromFunctions(object): self._module[self._new_instance] or using existing instance data. (specified with the keyword argument, instance) + if instance argument is None it will be ignored and the + constructor will be called to get a new instance + Pass the arguments that should be passed on to - self._module[self._new_instance] . Any arguments of that + self._module[self._new_instance]. Any arguments of that are instances of ClassFromFunctions will be switched with the instance data. (by calling the .instance property) """ - if INSTANCE_ARGUMENT in kargs: + if INSTANCE_ARGUMENT in kargs and kargs[INSTANCE_ARGUMENT] is not None: self.__instance = kargs[INSTANCE_ARGUMENT] else: self.__instance = getattr(self._module, self._new_instance)(