From 3140d454aef3ec5ec87d050166cb113333067f17 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 27 Jul 2021 08:01:56 +0200 Subject: [PATCH] fix Parameter/Command copy method in case the Parameter/Command is subclassed Change-Id: Ib34fc78e72cd04e743e35ef7ccd40b2eae03b614 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/26450 Tested-by: Jenkins Automated Tests Reviewed-by: Markus Zolliker --- secop/params.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/secop/params.py b/secop/params.py index 44d2933..6fe9274 100644 --- a/secop/params.py +++ b/secop/params.py @@ -233,7 +233,7 @@ class Parameter(Accessible): def copy(self): # deep copy, as datatype might be altered from config - res = Parameter() + res = type(self)() res.name = self.name res.init(self.propertyValues) res.datatype = res.datatype.copy() @@ -363,7 +363,7 @@ class Command(Accessible): return self def copy(self): - res = Command() + res = type(self)() res.name = self.name res.func = self.func res.init(self.propertyValues)