summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-13 15:38:44 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-01-13 15:39:27 +0700
commit433b761390648e0834e546216f99990727c97b05 (patch)
treef9b0048b33d433f71f81068e056dc1ba98a39d4e
parentd2004ae4f6c3de31a52fd5d3895ecf284dabcc89 (diff)
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
-rw-r--r--src/target/trx_toolkit/burst_fwd.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/target/trx_toolkit/burst_fwd.py b/src/target/trx_toolkit/burst_fwd.py
index 38ce18f..164271f 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: