Skip to content

Commit

Permalink
Merge pull request #7 from iamdefinitelyahuman/v1.2.1
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
iamdefinitelyahuman authored Mar 9, 2020
2 parents e3d5c29 + 8838913 commit 9def32e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.2.1
-----

- NodeBase.get bugfix when target is dict

1.2.0
-----

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion solcast/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 9def32e

Please sign in to comment.