lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/36127?usp=email )


Change subject: Revert "tlv: Fix from_dict() symmetry"
......................................................................

Revert "tlv: Fix from_dict() symmetry"

This reverts commit a9b21bdb1f24e3eabcee82950e4a3efdb90b2fa9.
The ara-m applet interface got broken by it.

Change-Id: I1710bf9124acf7952d3231b104407e9ac998d6a8
---
M pySim/tlv.py
1 file changed, 16 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/27/36127/1

diff --git a/pySim/tlv.py b/pySim/tlv.py
index 8bf43c6..bfaab6b 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -153,13 +153,13 @@
     def from_dict(self, decoded: dict):
         """Set the IE internal decoded representation to data from the 
argument.
         If this is a nested IE, the child IE instance list is re-created."""
-        expected_key_name = camel_to_snake(type(self).__name__)
-        if not expected_key_name in decoded:
-            raise ValueError("Dict %s doesn't contain expected key %s" % 
(decoded, expected_key_name))
         if self.nested_collection:
-            self.children = 
self.nested_collection.from_dict(decoded[expected_key_name])
+            self.children = self.nested_collection.from_dict(decoded)
         else:
             self.children = []
+            expected_key_name = camel_to_snake(type(self).__name__)
+            if not expected_key_name in decoded:
+                raise ValueError("Dict %s doesn't contain expected key %s" % 
(decoded, expected_key_name))
             self.decoded = decoded[expected_key_name]

     def is_constructed(self):

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36127?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1710bf9124acf7952d3231b104407e9ac998d6a8
Gerrit-Change-Number: 36127
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lyn...@fe80.eu>
Gerrit-MessageType: newchange

Reply via email to