diff --git a/CHANGELOG b/CHANGELOG index 0749ebe..ee03f14 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +1.2.1 +----- + + - NodeBase.get bugfix when target is dict + 1.2.0 ----- diff --git a/setup.py b/setup.py index 9bc0b68..be3fffa 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="py-solc-ast", - version="1.2.0", + version="1.2.1", description="""A tool for exploring the abstrax syntrax tree generated by solc.""", long_description=long_description, long_description_content_type="text/markdown", diff --git a/solcast/nodes.py b/solcast/nodes.py index 9796672..79002c3 100644 --- a/solcast/nodes.py +++ b/solcast/nodes.py @@ -191,7 +191,10 @@ def get(self, key, default=None): raise TypeError("Cannot match against None") obj = self for k in key.split("."): - obj = getattr(obj, k, None) + if isinstance(obj, dict): + obj = obj.get(k) + else: + obj = getattr(obj, k, None) return obj or default