From 433b761390648e0834e546216f99990727c97b05 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 13 Jan 2019 15:38:44 +0700 Subject: trx_toolkit/burst_fwd.py: fix trx_list cross-reference It was discovered that using an empty list as default argument value does result into the cross-reference, i.e. all instances of BurstForwarder would reference the same trx_list object. This is not an expected behaviour, let's fix this. Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1 --- src/target/trx_toolkit/burst_fwd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/target/trx_toolkit/burst_fwd.py b/src/target/trx_toolkit/burst_fwd.py index 38ce18f3..164271fe 100644 --- a/src/target/trx_toolkit/burst_fwd.py +++ b/src/target/trx_toolkit/burst_fwd.py @@ -43,9 +43,12 @@ class BurstForwarder: """ - def __init__(self, trx_list = []): + def __init__(self, trx_list = None): # List of Transceiver instances - self.trx_list = trx_list + if trx_list is not None: + self.trx_list = trx_list + else: + self.trx_list = [] def add_trx(self, trx): if trx in self.trx_list: -- cgit v1.2.3