aboutsummaryrefslogtreecommitdiffstats
path: root/pySim/tlv.py
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-07-09 21:25:14 +0200
committerHarald Welte <laforge@osmocom.org>2023-07-11 08:42:12 +0200
commit30de9fd8abc9d7c2c541fea7fa4b97c4ca1a54eb (patch)
treed83c0bd59e07964f6ba2d14d5712accb964caa52 /pySim/tlv.py
parentf818acd5eb669b7d28cb770434ce2b99d3b00169 (diff)
TLV_IE_Collection: use snake-style names during from_dict()
The TLV_IE_Collection, just like the individual TLV classes, do use their snake-style names when converting from binary to dict using the to_dict() method. It is inconsistent (and a bug) to expect the CamelCase names during encoding (from_dict). After all, we want the output of to_dict() to be used as input to from_dict(). Change-Id: Iabd1ad98c3878659d123eef919c22ca824886f8a
Diffstat (limited to 'pySim/tlv.py')
-rw-r--r--pySim/tlv.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pySim/tlv.py b/pySim/tlv.py
index bd95505..22a14cd 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -318,7 +318,7 @@ class TLV_IE_Collection(metaclass=TlvCollectionMeta):
self.members_by_tag = {}
self.members_by_name = {}
self.members_by_tag = {m.tag: m for m in self.members}
- self.members_by_name = {m.__name__: m for m in self.members}
+ self.members_by_name = {camel_to_snake(m.__name__): m for m in self.members}
# if we are a constructed IE, [ordered] list of actual child-IE instances
self.children = kwargs.get('children', [])
self.encoded = None