@@ -564,7 +564,7 @@ def _validate_policy_overrides(
564564def _handle_assign (node : ast .Assign , context : EvaluationContext ):
565565 value = eval_node (node .value , context )
566566 transient_locals = context .transient_locals
567- class_transients = getattr ( context , " class_transients" , None )
567+ class_transients = context . class_transients
568568 for target in node .targets :
569569 if isinstance (target , (ast .Tuple , ast .List )):
570570 # Handle unpacking assignment
@@ -748,10 +748,9 @@ def dummy_function(*args, **kwargs):
748748 value = _resolve_annotation (eval_node (node .annotation , context ), context )
749749 context .transient_locals [node .target .id ] = value
750750 # Handle non-simple annotated assignments only for self.x: type = value
751- class_transients = getattr (context , "class_transients" , None )
752751 if _is_instance_attribute_assignment (node .target , context ):
753752 value = _resolve_annotation (eval_node (node .annotation , context ), context )
754- class_transients [node .target .attr ] = value
753+ context . class_transients [node .target .attr ] = value
755754 return None
756755 if isinstance (node , ast .Expression ):
757756 return eval_node (node .body , context )
0 commit comments