Skip to content

Commit

Permalink
Fixed unhandled exception in ScopeProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
mad-cat-lon committed Aug 7, 2024
1 parent efcf477 commit e9d64ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jargonaut/transformations/layout/randomize_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def dummyFunc():
# Avoid messing with the lambda strings which use
# __code__ as well
dummyFunc.__code__
]
]
for t in types_to_inspect:
self.avoid_names.extend(method for method in dir(t))

Expand Down Expand Up @@ -91,7 +91,10 @@ def leave_Attribute(
original_node: cst.Attribute,
updated_node: cst.Attribute
) -> Optional[bool]:
scope = self.get_metadata(ScopeProvider, original_node)
try:
scope = self.get_metadata(ScopeProvider, original_node)
except KeyError:
return updated_node
qualified_names = list(scope.get_qualified_names_for(original_node))
qualified_name = qualified_names[0]
# print(f"scope: {scope} qualified_name: {qualified_name}")
Expand Down

0 comments on commit e9d64ff

Please sign in to comment.